summaryrefslogtreecommitdiffstats
path: root/scripts/netcfg-menu
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2012-12-28 02:38:58 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2012-12-28 02:38:58 +0100
commit4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d (patch)
tree09580c92ca78e8b9b54d7ed8d6b79d7fcd6fd9ff /scripts/netcfg-menu
parent6737a37e5666837a8f51a2f74bdebdd756151394 (diff)
downloadnetctl-4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d.tar.gz
netctl-4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d.tar.xz
Forking netcfg to netctl (1/2)
This commit contains the moving of files.
Diffstat (limited to 'scripts/netcfg-menu')
-rwxr-xr-xscripts/netcfg-menu55
1 files changed, 0 insertions, 55 deletions
diff --git a/scripts/netcfg-menu b/scripts/netcfg-menu
deleted file mode 100755
index 9a875ae..0000000
--- a/scripts/netcfg-menu
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/bash
-
-. /usr/lib/network/network
-
-if ! type dialog &> /dev/null; then
- echo "Please install 'dialog' to use netcfg-menu"
- exit 1
-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.)
-while read prof; do
- # if there is a profile called "main", Use as default
- [[ "$prof" = "main" ]] && DEFAULT="main"
- profiles[i++]="$prof"
- profiles[i++]=$(. "$PROFILE_DIR/$prof"; echo "$DESCRIPTION")
-done < <(list_profiles | sort) # JP: re-use list_profiles instead of duplicating it; avoid subshell we'd get by piping it to the while read...
-
-if [[ ${#profiles} -eq 0 ]]; then
- exit_err "No profiles were found in $PROFILE_DIR"
-fi
-
-[[ -n "$NETWORKS_MENU_DEFAULT" ]] && DEFAULT="$NETWORKS_MENU_DEFAULT"
-# if no default yet, use the first entry
-[[ -z "$DEFAULT" ]] && DEFAULT="${profiles[0]}"
-
-# Display Dialog
-PROFILE=$(dialog --timeout "$TIMEOUT" --default-item "$DEFAULT" --stdout \
- --menu 'Select the network profile you wish to use' \
- 13 50 6 "${profiles[@]}")
-ret=$?
-case $ret in
- 1) ;; # Cancel - do nothing
- 255|0) # Timeout (use default) or user selection
- [[ -z "$PROFILE" ]] && PROFILE="$DEFAULT"
- profile_up "$PROFILE"
- ret=$?
- (( ret == 0 )) && echo "$PROFILE" > "$STATE_DIR/menu"
- ;;
- *) # Should not happen
- exit_err "Abnormal return code from dialog: $ret"
- ;;
-esac
-
-exit $ret # JP: exit with caught $?
-
-# vim: ft=sh ts=4 et sw=4: