46 lines
1.6 KiB
Bash
46 lines
1.6 KiB
Bash
mrepo=https://git.ictmaatwerk.com/VPS-scripts/Backup-Util
|
|
mbranch=master
|
|
|
|
if [ -z ${ignphpcms+x} ]; then ignphpcms=0;fi
|
|
if [ $ignphpcms != 1 ]; then
|
|
############
|
|
# lftp #
|
|
############
|
|
|
|
sed -i -e '$a set ssl:verify-certificate no' /etc/lftp.conf
|
|
sed -i -e '$a set sftp:auto-confirm yes' /etc/lftp.conf
|
|
|
|
|
|
##############
|
|
# wp-cli #
|
|
##############
|
|
|
|
if [ ! -f /usr/local/bin/wp ]; then
|
|
wget -q -t7 https://raw.githubusercontent.com/wp-cli/wp-cli/v2.4.0/utils/wp-completion.bash -O /etc/bash_completion.d/wp
|
|
wget -q -t7 https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/local/bin/wp
|
|
chmod +x /usr/local/bin/wp
|
|
fi
|
|
|
|
|
|
###################
|
|
# Backup-UTIL #
|
|
###################
|
|
|
|
mkdir -p /opt/BackupUtil
|
|
sed -i "\$a30 3 * * * root bash /opt/BackupUtil/Backup-Util.sh >/dev/null 2>&1" /etc/crontab
|
|
systemctl restart cron
|
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/Backup-Util.sh -O /opt/BackupUtil/Backup-Util.sh
|
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/Backup-Util/Backup-Util.unconfigured -O /opt/BackupUtil/Backup-Util.conf
|
|
sed -i -e 's/PASSword/'$password'/g' -e 's/HOSTNAME/'$(hostname -s)'/g' /opt/BackupUtil/Backup-Util.conf
|
|
fi
|
|
|
|
|
|
##############################
|
|
# Backup-util Site Setup #
|
|
##############################
|
|
|
|
if [ -z ${db_suffix+x} ]; then db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`;fi
|
|
wget -q -t7 "$mrepo"/raw/branch/"$mbranch"/config/Motd/51-bckupnotice -O /etc/update-motd.d/51-bckupnotice
|
|
chmod +x /etc/update-motd.d/51-bckupnotice
|
|
source <(curl --retry 7 --retry-delay 5 -s "$mrepo"/raw/branch/"$mbranch"/cms-handeler.sh)
|