blob: 6ae07ca86c0aedfd1fb8fbf0d15dfe1aca1bae4b [file] [log] [blame]
Warren Togamib1637c82012-03-03 22:37:42 -10001#!/sbin/sh
Luca Stefani5c60e4f2017-08-17 19:28:48 +02002#
Dan Pasanen524fe032018-01-26 10:26:47 -06003# ADDOND_VERSION=2
4#
Jackeagled6811aa2019-09-24 08:26:40 +02005# /system/addon.d/50-bliss.sh
6# During a BlissRoms upgrade, this script backs up /system/etc/hosts,
Warren Togamib1637c82012-03-03 22:37:42 -10007# /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