data/scripts: remove some hardcoded paths

Origin commit data
------------------
Branch: ni/coolstream
Commit: 93ca7b0ef1
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-11-26 (Thu, 26 Nov 2020)

Origin message was:
------------------
- data/scripts: remove some hardcoded paths

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2020-11-26 00:46:21 +01:00
parent 5c088e7356
commit eab9b6c91f
8 changed files with 108 additions and 80 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/sh
. /etc/init.d/globals
RES=""
VAR="/var/"
USRF="@CONFIGDIR@/tobackup.conf"
BAKF="/var/backup_flash.tar.gz"
TOBACKUP=""
SHOWINFO "backup to ${BAKF} ..."
if [ -e "${USRF}" ]; then
TOBACKUP="$TOBACKUP ${USRF}"
while read i
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
done < $USRF
fi
# check existence and skip files in /var
for i in $TOBACKUP; do
if [ -e "$i" -a ${i:0:${#VAR}} != ${VAR} ]; then
SHOWINFO "add $i"
RES="$RES $i"
else
SHOWINFO "skip $i"
fi
done
TOBACKUP=$(echo $RES)
tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null
SHOWINFO "done."