diff --git a/setup/container/sudoers b/setup/container/sudoers index cb0a20e2c..7035312e1 100644 --- a/setup/container/sudoers +++ b/setup/container/sudoers @@ -31,3 +31,5 @@ yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/collectlogs.sh Defaults!/home/yellowtent/box/src/scripts/retire.sh env_keep="HOME BOX_ENV" yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/retire.sh +Defaults!/home/yellowtent/box/src/scripts/rmbackup.sh env_keep="HOME BOX_ENV" +yellowtent ALL=(root) NOPASSWD: /home/yellowtent/box/src/scripts/rmbackup.sh diff --git a/src/scripts/rmbackup.sh b/src/scripts/rmbackup.sh new file mode 100644 index 000000000..1c8f95647 --- /dev/null +++ b/src/scripts/rmbackup.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -eu -o pipefail + +if [[ ${EUID} -ne 0 ]]; then + echo "This script should be run as root." > /dev/stderr + exit 1 +fi + +if [[ $# -eq 0 ]]; then + echo "No arguments supplied" + exit 1 +fi + +if [[ "$1" == "--check" ]]; then + echo "OK" + exit 0 +fi + +# remove the file +rm -rf "${1}" diff --git a/src/test/checkInstall b/src/test/checkInstall index fea34cf16..97c899099 100755 --- a/src/test/checkInstall +++ b/src/test/checkInstall @@ -14,6 +14,7 @@ scripts=("${SOURCE_DIR}/src/scripts/rmappdir.sh" \ "${SOURCE_DIR}/src/scripts/reloadnginx.sh" \ "${SOURCE_DIR}/src/scripts/backupbox.sh" \ "${SOURCE_DIR}/src/scripts/backupapp.sh" \ + "${SOURCE_DIR}/src/scripts/rmbackup.sh" \ "${SOURCE_DIR}/src/scripts/restoreapp.sh" \ "${SOURCE_DIR}/src/scripts/reboot.sh" \ "${SOURCE_DIR}/src/scripts/collectlogs.sh" \