(simatec) Beta v0.9.0

This commit is contained in:
simatec 2023-01-23 12:51:07 +01:00
parent 9f46e3ac29
commit 68ebb3ba23
2 changed files with 31 additions and 46 deletions

View file

@ -277,7 +277,9 @@ fi
# Build Piler
cd $buildPth
bash build.sh
echo echo "${greenBold}Start Piler-Build...${normal}" && \
bash build.sh && \
echo "${greenBold}Piler-Build finish${normal}"
if [ -f $installPth/docker-compose.yml ]; then
rm $installPth/docker-compose.yml

View file

@ -170,12 +170,13 @@ if [ ! -d $installPth/backup ]; then
mkdir -p $installPth/backup
fi
cp $etcPth/config-site.php.bak $installPth/backup/ && cp $etcPth/config-site.php $installPth/backup/
cp $etcPth/piler.conf.bak $installPth/backup/ && cp $etcPth/piler.conf $installPth/backup/
cp $etcPth/.my.cnf $installPth/backup/
#cp $etcPth/config-site.php.bak $installPth/backup/ && cp $etcPth/config-site.php $installPth/backup/
#cp $etcPth/piler.conf.bak $installPth/backup/ && cp $etcPth/piler.conf $installPth/backup/
#cp $etcPth/.my.cnf $installPth/backup/
cp $etcPth/* $installPth/backup/
# delete old files
rm -f $etcPth/piler.key $etcPth/piler.pem $etcPth/config-site.php
#rm -f $etcPth/piler.key $etcPth/piler.pem $etcPth/config-site.php
# Added Manticore
if [ ! -f $etcPth/MANTICORE ]; then
@ -184,7 +185,9 @@ fi
# Build Piler
cd $buildPth
bash build.sh
echo echo "${greenBold}Start Piler-Build...${normal}" && \
bash build.sh && \
echo "${greenBold}Piler-Build finish${normal}"
# Copy docker-compose.yml
if [ "$USE_LETSENCRYPT" = "yes" ]; then
@ -218,52 +221,32 @@ else
docker-compose up --force-recreate --build -d
fi
echo "${blue}********* Piler started... Please wait... *********${normal}"
#echo "${blue}********* Piler started... Please wait... *********${normal}"
BLA::start_loading_animation "${BLA_metro[@]}"
sleep 20
BLA::stop_loading_animation
#BLA::start_loading_animation "${BLA_metro[@]}"
#sleep 20
#BLA::stop_loading_animation
# Restore Config
cp $installPth/backup/config-site.php.bak $etcPth/ && cp $installPth/backup/config-site.php $etcPth/
cp $installPth/backup/piler.conf.bak $etcPth/ && cp $installPth/backup/piler.conf $etcPth/
cp $installPth/backup/.my.cnf $etcPth/
if [ "$USE_MAILCOW" = true ]; then
echo
echo "${blue}${HLINE}"
echo "set Mailcow Api-Key config"
echo "${blue}${HLINE}${normal}"
echo
cat >> $etcPth/config-site.php <<EOF
// Mailcow API
\$config['MAILCOW_API_KEY'] = '$MAILCOW_APIKEY';
\$config['MAILCOW_SET_REALNAME'] = true;
\$config['CUSTOM_EMAIL_QUERY_FUNCTION'] = 'query_mailcow_for_email_access';
\$config['MAILCOW_HOST'] = '$MAILCOW_HOST'; // default $config['IMAP_HOST']
include('auth-mailcow.php');
EOF
curl -o $etcPth/auth-mailcow.php https://raw.githubusercontent.com/patschi/mailpiler-mailcow-integration/master/auth-mailcow.php
fi
#cp $installPth/backup/config-site.php.bak $etcPth/ && cp $installPth/backup/config-site.php $etcPth/
#cp $installPth/backup/piler.conf.bak $etcPth/ && cp $installPth/backup/piler.conf $etcPth/
#cp $installPth/backup/.my.cnf $etcPth/
#cp $installPth/backup/* $etcPth/
# piler restart
echo
echo "${blue}${HLINE}"
echo "${blue} restart piler ..."
echo "${blue}${HLINE}${normal}"
echo
#echo
#echo "${blue}${HLINE}"
#echo "${blue} restart piler ..."
#echo "${blue}${HLINE}${normal}"
#echo
cd $installPth
#cd $installPth
if [ $COMPOSE_VERSION = native ]; then
docker compose restart piler
else
docker-compose restart piler
fi
#if [ $COMPOSE_VERSION = native ]; then
# docker compose restart piler
#else
# docker-compose restart piler
#fi
echo
echo "${greenBold}${HLINE}"
@ -288,4 +271,4 @@ echo "${blue}You can remove the old unused containers on your system!"
echo "${blue}Execute the following command: docker system prune"
echo "${blue}${HLINE}${normal}"
echo
exit 0
exit 0