Browse files

Avoid overwriting interfaces when installing on VPS (#59)

* Avoid overwriting interfaces when installing on VPS

* Also backup the old interfaces file before overwriting it

* typo

* ifdown && ifup

* Update
  • Loading branch information...
1 parent 694bcf1 commit fce7129b62bb0cf801f465f486f61a97f60602db @enoch85 enoch85 committed on GitHub Nov 15, 2016
Showing with 15 additions and 1 deletion.
  1. +15 −1
@@ -39,16 +39,27 @@ then
exit 1
+# Check network
+echo "Testing if network is OK..."
+sleep 2
+service networking restart
+ wget -q --spider
+if [ $? -eq 0 ]
+ echo -e "\e[32mOnline!\e[0m"
echo "Setting correct interface..."
# Set correct interface
{ sed '/# The primary network interface/q' /etc/network/interfaces; printf 'auto %s\niface %s inet dhcp\n# This is an autoconfigured IPv6 interface\niface %s inet6 auto\n' "$IFACE" "$IFACE" "$IFACE"; } > /etc/network/
mv /etc/network/ /etc/network/interfaces
service networking restart
# Check network
echo "Testing if network is OK..."
sleep 2
-sudo ifdown $IFACE && sudo ifup $IFACE
+service networking restart
wget -q --spider
if [ $? -eq 0 ]
@@ -266,8 +277,11 @@ echo -e "\e[0m"
echo -e "Write this down, you will need it to set static IP"
echo -e "in your router later. It's included in this guide:"
echo -e " (step 1 - 5)"
+echo -e "Please note that we will backup the interfaces file to:"
+echo -e "/etc/network/interfaces.backup"
echo -e "\e[32m"
read -p "Press any key to set static IP..." -n1 -s
+cp /etc/network/interfaces /etc/network/interfaces.backup
echo -e "\e[0m"
ifdown $IFACE

0 comments on commit fce7129

Please sign in to comment.