summaryrefslogtreecommitdiffstats
path: root/scripts/net-rename
diff options
context:
space:
mode:
authorRémy Oudompheng <remy@archlinux.org>2011-06-19 18:37:11 +0200
committerRémy Oudompheng <remy@archlinux.org>2011-06-19 18:43:40 +0200
commitfa94ee0e4b0489ee0ce57ccd4c8e03da10a81382 (patch)
treee8386f0e3122118a437a57abfe4d4d497ed99bf9 /scripts/net-rename
parent99cb72a9e098e61407002d3339c0d842d580ccca (diff)
downloadnetctl-fa94ee0e4b0489ee0ce57ccd4c8e03da10a81382.tar.gz
netctl-fa94ee0e4b0489ee0ce57ccd4c8e03da10a81382.tar.xz
Move executable scripts to a separate scripts/ directory
Signed-off-by: Rémy Oudompheng <remy@archlinux.org>
Diffstat (limited to 'scripts/net-rename')
-rwxr-xr-xscripts/net-rename26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/net-rename b/scripts/net-rename
new file mode 100755
index 0000000..1a51ffe
--- /dev/null
+++ b/scripts/net-rename
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. /usr/lib/network/globals
+
+case "$1" in
+ start)
+ report_try "Renaming network devices"
+ ifrename -p -t
+ report_success
+
+ add_daemon net-rename
+ ;;
+ stop)
+ rm_daemon net-rename
+ # No stop neccesary, but add one to look nice on shutdown.
+ /bin/true
+ ;;
+ restart)
+ "$0" start
+ ;;
+ *)
+ exit_stderr "Usage: $0 {start|stop|restart}"
+ ;;
+esac
+
+# vim: ft=sh ts=4 et sw=4: