46 lines
734 B
Bash
46 lines
734 B
Bash
|
#!/sbin/sh
|
||
|
#
|
||
|
# ADDOND_VERSION=2
|
||
|
#
|
||
|
# /system/addon.d/60-ih8sn.sh.sh
|
||
|
# During a LineageOS upgrade, this script backs up ih8sn,
|
||
|
# /system is formatted and reinstalled, then the files are restored.
|
||
|
#
|
||
|
|
||
|
. /tmp/backuptool.functions
|
||
|
|
||
|
list_files() {
|
||
|
cat <<EOF
|
||
|
bin/ih8sn
|
||
|
etc/ih8sn.conf
|
||
|
etc/init/ih8sn.rc
|
||
|
EOF
|
||
|
}
|
||
|
|
||
|
case "$1" in
|
||
|
backup)
|
||
|
list_files | while read FILE DUMMY; do
|
||
|
backup_file $S/"$FILE"
|
||
|
done
|
||
|
;;
|
||
|
restore)
|
||
|
list_files | while read FILE REPLACEMENT; do
|
||
|
R=""
|
||
|
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
|
||
|
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
|
||
|
done
|
||
|
;;
|
||
|
pre-backup)
|
||
|
# Stub
|
||
|
;;
|
||
|
post-backup)
|
||
|
# Stub
|
||
|
;;
|
||
|
pre-restore)
|
||
|
# Stub
|
||
|
;;
|
||
|
post-restore)
|
||
|
# Stub
|
||
|
;;
|
||
|
esac
|