From a85ea6e7385004ee0ebd5a740e4c04b109b42ca0 Mon Sep 17 00:00:00 2001 From: Moritz Beller Date: Sun, 29 Jan 2012 18:32:48 +0100 Subject: [PATCH] Adds support for reconnecting currently connected profiles without explicitly specifying it (FS#28196). --- AUTHORS | 2 +- scripts/netcfg | 5 ++--- src/network | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 3ca9188..0790978 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,4 +4,4 @@ Kyle Fuller Andrea Scarpino Thomas Bächler Rémy Oudompheng - +Moritz Beller diff --git a/scripts/netcfg b/scripts/netcfg index 63fed27..a416813 100755 --- a/scripts/netcfg +++ b/scripts/netcfg @@ -2,7 +2,7 @@ . /usr/lib/network/network -NETCFG_VER=2.6.7 +NETCFG_VER=2.6.8 version() { @@ -78,8 +78,7 @@ case "$1" in -a|all-down) all_down;; -r|reconnect) - profile_down "$2" - profile_up "$2";; + reconnect "$2";; all-resume) all_resume;; all-suspend) diff --git a/src/network b/src/network index e1a57a2..213e36e 100644 --- a/src/network +++ b/src/network @@ -377,5 +377,20 @@ bring_interface() esac } +## Reconnects the profile supplied as argument +## If no argument supplied, reconnects all profiles +# $1: the profile to be reconnected (optional) +reconnect() +{ +if [[ -n $1 ]]; then + profile_down "$1" + profile_up "$1" +else + all_suspend + all_resume +fi +} + + # vim: ft=sh ts=4 et sw=4: -- 1.7.8.4