summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-02-27 17:11:21 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2012-02-27 17:11:21 +0100
commit8d1c5e8ec6b637015e84bbb154ece9065c59f1c5 (patch)
tree573516ed0a5a8af5ba0a50b706af63d0ae4eef5d /src/network
parentd31febe0879d156c05dc47bb8ecbdf2cfee92238 (diff)
downloadnetctl-8d1c5e8ec6b637015e84bbb154ece9065c59f1c5.tar.gz
netctl-8d1c5e8ec6b637015e84bbb154ece9065c59f1c5.tar.xz
Reconnect syntax for interfaces (FS#28196)
It is now possible to reconnect based on the name of the interface.
Diffstat (limited to 'src/network')
-rw-r--r--src/network26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/network b/src/network
index e1a57a2..5823411 100644
--- a/src/network
+++ b/src/network
@@ -265,12 +265,28 @@ quirk() {
#
interface_down()
{
- local status=$(check_iface "$1")
- case "$status" in
- disabled) return 0 ;;
- "") return 0 ;;
+ local profile=$(check_iface "$1")
+ case "$profile" in
+ ""|disabled) return 0 ;;
external) return 1 ;;
- *) profile_down "$status" ;;
+ *) profile_down "$profile" ;;
+ esac
+}
+
+
+# interface_reconnect interface
+# reconnects the profile active on interface
+interface_reconnect()
+{
+ local profile=$(check_iface "$1")
+ case "$profile" in
+ ""|disabled|external)
+ return 1
+ ;;
+ *)
+ profile_down "$profile"
+ profile_up "$profile"
+ ;;
esac
}