blob: cf9d8155a427f3c66dff6e2d8b7db77a1f5545ae [file] [log] [blame]
Warren Togamib1637c82012-03-03 22:37:42 -10001#!/sbin/sh
Luca Stefani5c60e4f2017-08-17 19:28:48 +02002#
3# /system/addon.d/50-lineage.sh
Adrian DC93256e42017-12-07 01:34:33 +01004# During a LineageOS 15.1 upgrade, this script backs up /system/etc/hosts,
Warren Togamib1637c82012-03-03 22:37:42 -10005# /system is formatted and reinstalled, then the file is restored.
6#
7
8. /tmp/backuptool.functions
9
10list_files() {
11cat <<EOF
12etc/hosts
13EOF
14}
15
16case "$1" in
17 backup)
18 list_files | while read FILE DUMMY; do
19 backup_file $S/"$FILE"
20 done
21 ;;
22 restore)
23 list_files | while read FILE REPLACEMENT; do
24 R=""
25 [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
26 [ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
27 done
28 ;;
29 pre-backup)
30 # Stub
31 ;;
32 post-backup)
33 # Stub
34 ;;
35 pre-restore)
36 # Stub
37 ;;
38 post-restore)
39 # Stub
40 ;;
41esac