myvesta/bin/v-delete-backup-ftp-host
2013-10-27 13:54:31 +02:00

46 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# info: delete backup ftp server
# options: NONE
#
# The function deletes ftp backup host
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Checking network connection
rm -f $VESTA/conf/ftp.backup.conf
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Update vesta.conf
bckp=$(echo "$BACKUP_SYSTEM" |\
sed "s/,/\n/g"|\
sed "s/ftp//" |\
sed "/^$/d"|\
sed ':a;N;$!ba;s/\n/,/g')
sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
# Logging
log_event "$OK" "$EVENT"
exit