1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Updated installer to properly make symlinks to latest backup

This commit is contained in:
Lawrence 2017-10-03 12:19:35 +08:00
parent 036b7a3050
commit 0b7b0a4d96

View File

@ -114,23 +114,23 @@ function change_file_ownership() {
# Check for existing /etc/network/interfaces and /etc/hostapd/hostapd.conf files # Check for existing /etc/network/interfaces and /etc/hostapd/hostapd.conf files
function check_for_old_configs() { function check_for_old_configs() {
if [ -f /etc/network/interfaces ]; then if [ -f /etc/network/interfaces ]; then
sudo mv /etc/network/interfaces "$raspap_dir/backups/interfaces.`date +%F-%R`" sudo cp /etc/network/interfaces "$raspap_dir/backups/interfaces.`date +%F-%R`"
ln -s "$raspap_dir/backups/interfaces.`date +%F-%R`" "$raspap_dir/backups/interfaces" sudo ln -sf "$raspap_dir/backups/interfaces.`date +%F-%R`" "$raspap_dir/backups/interfaces"
fi fi
if [ -f /etc/hostapd/hostapd.conf ]; then if [ -f /etc/hostapd/hostapd.conf ]; then
sudo mv /etc/hostapd/hostapd.conf "$raspap_dir/backups/hostapd.conf.`date +%F-%R`" sudo cp /etc/hostapd/hostapd.conf "$raspap_dir/backups/hostapd.conf.`date +%F-%R`"
ln -s "$raspap_dir/backups/hostapd.conf.`date +%F-%R`" "$raspap_dir/backups/hostapd.conf" sudo ln -sf "$raspap_dir/backups/hostapd.conf.`date +%F-%R`" "$raspap_dir/backups/hostapd.conf"
fi fi
if [ -f /etc/dnsmasq.conf ]; then if [ -f /etc/dnsmasq.conf ]; then
sudo mv /etc/dnsmasq.conf "$raspap_dir/backups/dnsmasq.conf.`date +%F-%R`" sudo cp /etc/dnsmasq.conf "$raspap_dir/backups/dnsmasq.conf.`date +%F-%R`"
ln -s "$raspap_dir/backups/dnsmasq.conf.`date +%F-%R`" "$raspap_dir/backups/dnsmasq.conf" sudo ln -sf "$raspap_dir/backups/dnsmasq.conf.`date +%F-%R`" "$raspap_dir/backups/dnsmasq.conf"
fi fi
if [ -f /etc/dhcpcd.conf ]; then if [ -f /etc/dhcpcd.conf ]; then
sudo mv /etc/dhcpcd.conf "$raspap_dir/backups/dhcpcd.conf.`date +%F-%R`" sudo cp /etc/dhcpcd.conf "$raspap_dir/backups/dhcpcd.conf.`date +%F-%R`"
ln -s "$raspap_dir/backups/dhcpcd.conf.`date +%F-%R`" "$raspap_dir/backups/dhcpcd.conf" sudo ln -sf "$raspap_dir/backups/dhcpcd.conf.`date +%F-%R`" "$raspap_dir/backups/dhcpcd.conf"
fi fi
} }