summaryrefslogtreecommitdiff
path: root/localnetcfgchange
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-01-17 21:42:37 +0000
committerJonas Smedegaard <dr@jones.dk>2008-01-17 21:42:37 +0000
commit4d889b8d14354c9a45aad19f3e854a1d70487d28 (patch)
tree7325ed7aefec0cea8dda3ab93bac2c5e941dd36e /localnetcfgchange
parent27524b69887ae4d3af570d5ed5428e16b5f6850e (diff)
New script to swithc network config.
Diffstat (limited to 'localnetcfgchange')
-rwxr-xr-xlocalnetcfgchange18
1 files changed, 18 insertions, 0 deletions
diff --git a/localnetcfgchange b/localnetcfgchange
new file mode 100755
index 0000000..7728eeb
--- /dev/null
+++ b/localnetcfgchange
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Copyright 2008 Jonas Smedegaard <dr@jones.dk>
+# Licensed as GNU General Public License (GPL) version 2.
+
+# Switch network config
+
+set -e
+
+flavor="$1"
+
+title=${2:-Network setup}
+text=${3:-Network setup succesfully changed. The change takes effect after next system restart.}
+
+if [ -f "/etc/network/interfaces.$1" ]; then
+ gksudo "/bin/cp -f \"/etc/network/interfaces.$1\" /etc/network/interfaces" \
+ && zenity --info --title "$title" --text "$text"
+fi