v-delete-backup-ftp-host 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. # info: delete backup ftp server
  3. # options: NONE
  4. #
  5. # The function deletes ftp backup host
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Includes
  10. source $VESTA/conf/vesta.conf
  11. source $VESTA/func/main.sh
  12. #----------------------------------------------------------#
  13. # Verifications #
  14. #----------------------------------------------------------#
  15. #----------------------------------------------------------#
  16. # Action #
  17. #----------------------------------------------------------#
  18. # Checking network connection
  19. rm -f $VESTA/conf/ftp.backup.conf
  20. #----------------------------------------------------------#
  21. # Vesta #
  22. #----------------------------------------------------------#
  23. # Update vesta.conf
  24. bckp=$(echo "$BACKUP_SYSTEM" |\
  25. sed -e "s/,/\n/g"|\
  26. sed -e "s/ftp//" |\
  27. sed -e "/^$/d"|\
  28. sed -e ':a;N;$!ba;s/\n/,/g')
  29. sed -i "s/BACKUP_SYSTEM=.*/BACKUP_SYSTEM='$bckp'/g" $VESTA/conf/vesta.conf
  30. # Logging
  31. log_event "$OK" "$EVENT"
  32. exit