platform_vendor_tequila/prebuilt/common/bin/50-cm.sh
Adrian DC 9b4114ee47
vendor: cm: Updates for CM-14.0
* Fix the backuptool for the new version
 * Update text references

Change-Id: I3d557cc4eb5feb07ebbff372dae6d165d29d94ee
2016-09-03 20:31:52 +02:00

41 lines
682 B
Bash
Executable file

#!/sbin/sh
#
# /system/addon.d/50-cm.sh
# During a CM14.0 upgrade, this script backs up /system/etc/hosts,
# /system is formatted and reinstalled, then the file is restored.
#
. /tmp/backuptool.functions
list_files() {
cat <<EOF
etc/hosts
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