summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-06-21 12:13:26 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-06-21 12:13:26 +0200
commit4e034777fa0bfffa11d87b602e6b2b941edd3262 (patch)
tree576f454a6490c95a46cefae20c1fb91dae7edca8 /src/network
parent5e6d2bab4138c2be491488e574baf17e32f8679c (diff)
downloadnetctl-4e034777fa0bfffa11d87b602e6b2b941edd3262.tar.gz
netctl-4e034777fa0bfffa11d87b602e6b2b941edd3262.tar.xz
Minor improvements
After this change, a profile started by a previous version of netcfg can potentially not be brought down anymore. This only concerns the updating process. Running `netcfg clean` should make everything OK again (potentially leaving your network down, but you can now bring up profiles again).
Diffstat (limited to 'src/network')
-rw-r--r--src/network9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/network b/src/network
index e8c2ae1..1c466c7 100644
--- a/src/network
+++ b/src/network
@@ -295,11 +295,8 @@ interface_reconnect()
# Return 1 if interface down and available to be used
#
check_iface() {
- if [[ -f "$STATE_DIR/interfaces/$1" ]]; then (
- . "$STATE_DIR/interfaces/$1"
- echo "$PROFILE" # may be: external, disabled, or a profile name
- return 0
- )
+ if [[ -f "$STATE_DIR/interfaces/$1" ]]; then
+ echo "$(< "$STATE_DIR/interfaces/$1")"
return 0
else
return 1
@@ -347,7 +344,7 @@ set_profile() {
set_iface() {
local PROFILE="${3:-external}"
if [[ "$1" == "up" ]]; then
- echo "PROFILE='$PROFILE'" > "$STATE_DIR/interfaces/$2"
+ echo "$PROFILE" > "$STATE_DIR/interfaces/$2"
elif [[ "$1" == "down" ]]; then
rm -f "$STATE_DIR/interfaces/$2" # JP: add -f so we don't complain if the interface isn't up
fi