# install script # Inhalt von backup.service # HERE Document https://ss64.com/bash/syntax-here.html SERVICE=$(cat <&1 1>&2 2>&3) check_exit_status } function dialog2 { BACKUPZIEL=$(whiptail --inputbox "Backup Ziel?" 8 78 localhost --title "rsync Backupziel" 3>&1 1>&2 2>&3) check_exit_status } function check_exit_status { exitstatus=$? if [ $exitstatus = 1 ]; then echo "User selected Cancel." exit 1 fi } function install_service { cp wp-backup.sh /bin/ && \ cp backup.timer /etc/systemd/system/ && \ echo "$SERVICE" > /etc/systemd/system/backup.service && \ systemctl enable --now backup.timer || fail } function fail { echo "Fehler!!" exit 1 } #funktions aufrufe dialog1 dialog2 install_service exit 0