1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/restic_ynh.git synced 2024-09-03 20:16:22 +02:00

Do not use expect anymore

This commit is contained in:
Lionel Coupouchetty-Ramouchetty 2020-04-12 17:13:11 +02:00
parent 32539a2070
commit 25e47e2cac
7 changed files with 5 additions and 23 deletions

View file

@ -128,7 +128,3 @@ yunohost app setting restic apps -v "nextcloud,wordpress"
## Backup on different server, and apply distinct schedule for apps
You can setup the restic app several times on the same server so you can backup on several server or manage your frequency backup differently for specific part of your server.
## TODO
* Remove expect message when question was not matched

View file

@ -1,6 +0,0 @@
#!/usr/bin/expect -f
set timeout -1
spawn /usr/local/bin/backup-with-{{ app }}
expect -re "Some files couldn't be prepared.*Do you agree?"
send -- "{% if allow_extra_space_use %}y{% else %}n{% endif %}\r"
expect eof

View file

@ -4,7 +4,7 @@ After=network.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup-with-__APP__-answerbot
ExecStart=/usr/local/bin/backup-with-__APP__
ExecStartPost=/bin/bash -c 'echo -e "Subject: YunoHost Restic backup log on $(hostname)\n$(/bin/journalctl _SYSTEMD_INVOCATION_ID=`systemctl show -p InvocationID --value __APP__.service`)" | /usr/sbin/sendmail root'
User=root
Group=root

View file

@ -7,8 +7,6 @@
PKG_DIR=$(cd ../; pwd)
RESTIC_VERSION="0.9.6"
pkg_dependencies="expect"
# Install restic if restic is not here
install_restic () {
architecture=$(uname -m)

View file

@ -31,11 +31,9 @@ ynh_export server port ssh_user backup_path passphrase on_calendar check_on_cale
ynh_save_args server port ssh_user backup_path passphrase on_calendar check_on_calendar check_read_data_on_calendar conf data apps allow_extra_space_use
#=================================================
# INSTALL DEPENDENCIES
# INSTALL RESTIC
#=================================================
ynh_script_progression --message="Installing dependencies" --weight=7
ynh_install_app_dependencies $pkg_dependencies
ynh_script_progression --message="Installing restic binary" --weight=4
ynh_script_progression --message="Installing restic binary" --weight=7
install_restic
#=================================================
@ -57,10 +55,8 @@ ynh_configure check_method "${final_path}/check_method"
#=================================================
ynh_script_progression --message="Configuring cron" --weight=5
ynh_configure backup-with-restic "/usr/local/bin/backup-with-${app}"
ynh_configure backup-with-restic-answerbot "/usr/local/bin/backup-with-${app}-answerbot"
ynh_configure check-restic "${final_path}/check-${app}"
chmod u+x "/usr/local/bin/backup-with-${app}"
chmod u+x "/usr/local/bin/backup-with-${app}-answerbot"
chmod u+x "${final_path}/check-${app}"
chmod u+x "${final_path}/check_method"
ynh_add_systemd_config --service=${app} --template=systemd.service

View file

@ -25,9 +25,8 @@ app=$YNH_APP_INSTANCE_NAME
server=$(ynh_app_setting_get $app server)
#=================================================
# INSTALL DEPENDENCIES
# INSTALL RESTIC
#=================================================
ynh_install_app_dependencies $pkg_dependencies
install_restic
#=================================================

View file

@ -41,7 +41,6 @@ if grep "restic.timer" /etc/yunohost/services.yml > /dev/null ; then
fi
#=================================================
# INSTALL DEPENDENCIES
# INSTALL RESTIC
#=================================================
ynh_install_app_dependencies $pkg_dependencies
install_restic