* Change necessary bits to support our project move Change-Id: I085470d448a243cc9d60b4ce920dee52086f64cd
		
			
				
	
	
		
			42 lines
		
	
	
		
			690 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			690 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/sbin/sh
 | 
						|
# 
 | 
						|
# /system/addon.d/50-cm.sh
 | 
						|
# During a LineageOS 14.1 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
 |