summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-09-24 22:23:07 +0200
committerJouke Witteveen <j.witteveen@gmail.com>2012-09-24 22:23:07 +0200
commit62b93e31b673d2fc2d0510ebaf18f66645795b8a (patch)
tree6d8f518e7ea5e5b246ba7772685e80a96fdfe4de
parent95489893245a5ffedcb217c65b04bcab46511e5f (diff)
downloadnetctl-62b93e31b673d2fc2d0510ebaf18f66645795b8a.tar.gz
netctl-62b93e31b673d2fc2d0510ebaf18f66645795b8a.tar.xz
Small comments revision
Also fix an output string.
-rwxr-xr-xscripts/netcfg-daemon2
-rwxr-xr-xscripts/netcfg-menu15
2 files changed, 6 insertions, 11 deletions
diff --git a/scripts/netcfg-daemon b/scripts/netcfg-daemon
index d0b6f7c..98f96d6 100755
--- a/scripts/netcfg-daemon
+++ b/scripts/netcfg-daemon
@@ -19,7 +19,7 @@ case "$1" in
[[ -e $LAST_STATE ]] || exit_err "No recorded netcfg state to restore"
# The order in LAST_STATE is meaningless so we can just as
- # well start the profiles in the background.
+ # well start the profiles in parallel.
while read profile; do
if /usr/bin/netcfg up "$profile"; then
echo "$profile" >> "$STATE_FILE"
diff --git a/scripts/netcfg-menu b/scripts/netcfg-menu
index 86b5d09..9a875ae 100755
--- a/scripts/netcfg-menu
+++ b/scripts/netcfg-menu
@@ -8,10 +8,12 @@ if ! type dialog &> /dev/null; then
fi
check_make_state_dir
-
# JP: we'll use $STATE_DIR/menu to record what profile is being connected in this way
rm -f "$STATE_DIR/menu"
+# Set timeout
+TIMEOUT=${1-0}
+
# Scan all profiles
i=0
# JP: change for prof to while read prof to avoid assumption that profile names are always single tokens (no spaces etc.)
@@ -30,13 +32,6 @@ fi
# if no default yet, use the first entry
[[ -z "$DEFAULT" ]] && DEFAULT="${profiles[0]}"
-# Set timeout
-if [[ -z "$1" ]]; then
- TIMEOUT="0"
-else
- TIMEOUT="$1"
-fi
-
# Display Dialog
PROFILE=$(dialog --timeout "$TIMEOUT" --default-item "$DEFAULT" --stdout \
--menu 'Select the network profile you wish to use' \
@@ -50,8 +45,8 @@ case $ret in
ret=$?
(( ret == 0 )) && echo "$PROFILE" > "$STATE_DIR/menu"
;;
- *) # Shouldnt happen
- exit_err "Abnormal ret code from dialog: $ret"
+ *) # Should not happen
+ exit_err "Abnormal return code from dialog: $ret"
;;
esac