-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path50-lineage.sh
50 lines (47 loc) · 910 Bytes
/
50-lineage.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/system/bin/sh
#
# ADDOND_VERSION=2
#
# /system/addon.d/50-lineage.sh
# During a LineageOS upgrade, this script backs up /system/etc/hosts,
# /system is formatted and reinstalled, then the file is restored.
#
. /postinstall/tmp/backuptool.functions
list_files() {
cat <<EOF
etc/hosts
etc/myboot.sh
etc/init/myboot.rc
etc/dnscrypt-proxy.blocklist.txt
etc/dnscrypt-proxy.allowedlist.txt
etc/dnscrypt-proxy.cloaking-rules.txt
etc/dnscrypt-proxy.toml
bin/dnscrypt-proxy
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