- data/scripts: remove some hardcoded paths

Conflicts:
	data/config/settingsupdate.conf.in
	data/scripts/backup.sh
	data/scripts/backup_flash.sh.in
	data/scripts/restore_flash.sh.in

Signed-off-by: Thilo Graf <dbt@novatux.de>

Files adapted because conflicts and possible build errors.
This commit is contained in:
svenhoefer
2020-11-26 00:46:21 +01:00
committed by Thilo Graf
parent f57fac5a5a
commit 37fb4e4e4f
7 changed files with 103 additions and 11 deletions

31
data/scripts/backup.sh.in Normal file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
HOST=$(hostname)
DATE=$(date +%Y%m%d_%H%M)
USRF="@CONFIGDIR@/tobackup.conf"
BAKF="$1/${2:-settings_${HOST}_${DATE}}.tar.gz"
if [ -e "${USRF}" ]; then
# read user-files from $USRF
TOBACKUP="${USRF}"
while read i
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
done < $USRF
else
TOBACKUP="@CONFIGDIR@/"
fi
# check existence
RES=""
for i in $TOBACKUP
do [ -e "$i" ] && RES="$RES $i"
done
TOBACKUP=$(echo $RES)
echo Backup to $BAKF
tar -czf $BAKF $TOBACKUP 2>&1 >/dev/null