1
0
mirror of https://github.com/xzeldon/vwdump.git synced 2025-07-14 06:34:36 +03:00

Allow to run /backup.sh script as standalone

fixes #5
This commit is contained in:
10
2019-05-24 01:40:45 +02:00
parent b9fe712fda
commit 1a200567eb
2 changed files with 16 additions and 2 deletions

14
entrypoint.sh Normal file → Executable file
View File

@ -1,9 +1,23 @@
#!/bin/sh
# vim: tabstop=2 shiftwidth=2 expandtab
#set -ux
BACKUP_CMD="/sbin/su-exec ${UID}:${GID} /app/backup.sh"
# For compatibility reasons
if [ "$1" = "/backup.sh" ]; then
>&2 echo "Using /backup.sh is deprecated and will be removed in future versions! Please use \`manual\` as arugment instead"
$BACKUP_CMD
fi
# Just run the backup script
if [ "$1" = "manual" ]; then
$BACKUP_CMD
fi
exit 0
# Initialize cron
echo "Running as $(id)"
if [ "$(id -u)" -eq 0 ] && [ "$(grep -c "$BACKUP_CMD" "$CRONFILE")" -eq 0 ]; then
echo "Initalizing..."