AK2: add restore_file for use with ramdisk-only in a restore zip (#19)

thanks @Zackptg5
This commit is contained in:
osm0sis committed 2018-03-22 13:42:57 -03:00
1 parent 722da17775
commit 4a7014d5aa
1 file changed
+3
+3
View File
@@ -346,6 +346,9 @@ write_boot() {
# backup_file <file> # backup_file <file>
backup_file() { test ! -f $1~ && cp $1 $1~; } backup_file() { test ! -f $1~ && cp $1 $1~; }
# restore_file <file>
restore_file() { test -f $1~ && mv -f $1~ $1; }
# replace_string <file> <if search string> <original string> <replacement string> # replace_string <file> <if search string> <original string> <replacement string>
replace_string() { replace_string() {
if [ -z "$(grep "$2" $1)" ]; then if [ -z "$(grep "$2" $1)" ]; then