From 7e1d9d9cceb0dab6e32b87106aa120a4d2bb3f1f Mon Sep 17 00:00:00 2001 From: Lucky Bassi Date: Fri, 15 Dec 2023 13:29:50 +0100 Subject: [PATCH] fix(script): minor fixes --- script/network_config.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/network_config.sh b/script/network_config.sh index b94402d..89e71fb 100755 --- a/script/network_config.sh +++ b/script/network_config.sh @@ -121,9 +121,11 @@ echo "" read -p "Apply this network configuration? [yes/no]: " apply_conf if [[ $apply_conf == [Yy]* ]]; then - mv /etc/network/interfaces /etc/network/interfaces.old - mv interfaces /etc/network/interfaces + timestamp=$(date +%Y%m%d-%H%M%S) + mv /etc/network/interfaces /etc/network/interfaces.bak-$timestamp + mv /tmp/new_interfaces /etc/network/interfaces echo "The network can be restarted with the following command: /etc/init.d/networking restart" else echo "Exiting without applying changes." + rm /tmp/new_interfaces fi