Updated install and uninstall scripts to append to rc.local rather than overwrite the file

This commit is contained in:
Lawrence
2017-10-21 22:39:29 +08:00
parent 6fefbf7a2d
commit 908f0de8cb
2 changed files with 36 additions and 1 deletions

View File

@@ -63,10 +63,23 @@ function check_for_backups() {
fi
if [ -f "$raspap_dir/backups/dhcpcd.conf" ]; then
echo -n "Restore the last dhcpcd.conf file? [y/N]: "
read answer
if [[ $answer -eq 'y' ]]; then
sudo cp "$raspap_dir/backups/dhcpcd.conf" /etc/dhcpcd.conf
fi
fi
if [ -f "$raspap_dir/backups/rc.local" ]; then
echo -n "Restore the last rc.local file? [y/N]: "
read answer
if [[ $answer -eq 'y' ]]; then
sudo cp "$raspap_dir/backups/rc.local" /etc/rc.local
else
echo -n "Remove RaspAP Lines from /etc/rc.local? [Y/n]: "
if $answer -ne 'n' ]]; then
sed -i '/#RASPAP/d' /etc/rc.local
fi
fi
fi
fi
}