From 847fc435f84f270515059f2f8f5624d0e1faeb52 Mon Sep 17 00:00:00 2001 From: sparklyballs Date: Tue, 6 Jun 2017 03:09:38 +0100 Subject: [PATCH] tidy up init script with unneccesary sed --- root/defaults/backup | 2 +- root/defaults/script.sh | 4 +++- root/etc/cont-init.d/30-config | 7 ------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/root/defaults/backup b/root/defaults/backup index 120e7b1..2b4f982 100644 --- a/root/defaults/backup +++ b/root/defaults/backup @@ -1,2 +1,2 @@ -21 02 * * * /bin/sh /defaults/script.sh +21 02 * * * /bin/bash /defaults/script.sh diff --git a/root/defaults/script.sh b/root/defaults/script.sh index b026c4d..54eca5f 100644 --- a/root/defaults/script.sh +++ b/root/defaults/script.sh @@ -7,7 +7,9 @@ FOLDER_MAKE="/backup/${FOLDER_DATE}" REPO_USER=${REPO_USER:-linuxserver} # delete folders older than 20 days -for i in $(find /backup/ -maxdepth 1 -type d -mtime +20 -print); do echo -e "Deleting directory $i";rm -rf $i; done +for i in $(find /backup/ -maxdepth 1 -type d -mtime +20 -print); do +echo -e "Deleting directory $i";rm -rf $i +done # make today's folders if [ -d "${FOLDER_MAKE}" ]; then diff --git a/root/etc/cont-init.d/30-config b/root/etc/cont-init.d/30-config index e372831..ea98cb7 100644 --- a/root/etc/cont-init.d/30-config +++ b/root/etc/cont-init.d/30-config @@ -4,13 +4,6 @@ [[ ! -e /config/backup ]] && \ cp /defaults/backup /config/backup -# set user repo -if [[ -z $USER_REPO ]]; then -USER_REPO="linuxserver" -fi - -sed -i "s/REPO_USER=\".*\"/REPO_USER=\"${USER_REPO}\"/g" /defaults/script.sh - # set cron job crontab /config/backup