summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2017-08-01 01:52:09 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2017-08-01 01:52:09 +0200
commite2869cfe4215cc27f2c04ebf8cd26ee1abbd36dc (patch)
tree0daeb2aa1daeb42edb016efa38f7485609a3f206
parent70ba9f13b3ac6f95269fcd78b16e4c50d476ec0b (diff)
downloadbin-e2869cfe4215cc27f2c04ebf8cd26ee1abbd36dc.zip
bin-e2869cfe4215cc27f2c04ebf8cd26ee1abbd36dc.tar.gz
add netset
-rwxr-xr-xnetset20
1 files changed, 20 insertions, 0 deletions
diff --git a/netset b/netset
new file mode 100755
index 0000000..b1627c2
--- /dev/null
+++ b/netset
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+NETCTL=$(which netctl)
+if [ -z "$NETCTL" ]
+then
+ echo "netctl not found"
+ exit 1
+fi
+if [ $UID -ne 0 ]
+then
+ echo "must be run as root"
+ exit 1
+fi
+$NETCTL stop-all
+PROFILES=$($NETCTL list)
+select profile in $PROFILES
+do
+ [ -z "$profile" ] && exit 0
+ echo "starting profile $profile" && $NETCTL start $profile; break
+done