replicant-vendor_replicant/prebuilt/common/bin/50-cm.sh
Joseph Stahl 320b73eb6c fix for a typo in the comments of 50-cm.sh
Updated the file to reflect its use in CM10.

Change-Id: I7d4759798c75d2e2163e34c0d3b6fde8266e4756
2012-09-15 12:57:03 -05:00

42 lines
680 B
Bash
Executable File

#!/sbin/sh
#
# /system/addon.d/50-cm.sh
# During a CM10 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