blob: a4bf2f0fbab1151a61a7144a54f11d06079a3ab9 [file] [log] [blame]
Dan Pasanen5a8e34c2018-07-15 13:02:00 +02001#!/sbin/sh
2#
3# ADDOND_VERSION=2
4#
5# /system/addon.d/50-bliss.sh
6# During a Slim upgrade, this script backs up /system/etc/hosts,
7# /system is formatted and reinstalled, then the file is restored.
8#
9
10. /tmp/backuptool.functions
11
12list_files() {
13cat <<EOF
14etc/hosts
15EOF
16}
17
18case "$1" in
19 backup)
20 list_files | while read FILE DUMMY; do
21 backup_file $S/"$FILE"
22 done
23 ;;
24 restore)
25 list_files | while read FILE REPLACEMENT; do
26 R=""
27 [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
28 [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
29 done
30 ;;
31 pre-backup)
32 # Stub
33 ;;
34 post-backup)
35 # Stub
36 ;;
37 pre-restore)
38 # Stub
39 ;;
40 post-restore)
41 # Stub
42 ;;
43esac