After about an hour trying to work out why my netenv
configuration wasn't working I've put together the following
patch which allows spaces in the descriptions for the
nevenv environments.
e.g.:
feynman:/etc/netenv# grep netenv_id
feynman.home.woodall.me.uk-home
netenv_id="Home lan dhcp setup"
This patch is against the /sbin/netenv from Debian Sarge.
feynman:/sbin# diff -uN netenv.orig netenv
--- netenv.orig 2005-02-21 09:54:00.000000000 +0000
+++ netenv 2005-06-04 17:19:43.000000000 +0100
@@ -338,7 +338,7 @@
choose_network_environment()
{
- ITEM_LIST="" # have to be reentrant as of 0.93 ...
+ ITEM_LIST=( ) # have to be reentrant as of 0.93 ...
# The ls gives a list of files starting with the current node
name,
# excluding emacs backup files. The list starts with the
default
# and ends with ask.
@@ -353,10 +353,10 @@
LENGTH=$((${#NODE}+1))
SUFFIX=${SUFFIX:$LENGTH}
fi
- ITEM_LIST=$ITEM_LIST" "$SUFFIX" "$netenv_id
+ ITEM_LIST=( "${ITEM_LIST[@]}" "$SUFFIX"
"$netenv_id" )
done
- ITEM_LIST=$ITEM_LIST" "new"
"Set_up_new_environment
+ ITEM_LIST=( "${ITEM_LIST[@]}" "new" "Set up new
environment" )
CHOOSE_TITLE_TEXT="netenv $NETENV_VERSION
on $NODE running `uname -s` `uname -r`\n\nChoose your
current network-environment
!"
NETENV_REMEMBER_LAST=`echo
"$NETENV_REMEMBER_LAST" | tr 'A-Z' 'a-z'`
if [ \( X"$NETENV_REMEMBER_LAST" = Xyes -o
X"$NETENV_REMEMBER_LAST" = Xdefault \) -a
-r /var/cache/netenv/lastitem ]; then
@@ -364,7 +364,7 @@
else
LAST_ITEM=""
fi
- $DIALOG --default-item "$LAST_ITEM" --timeout
$NETENV_TIMEOUT --menu "$CHOOSE_TITLE_TEXT" 20
$COLS 12 $ITEM_LIST 2>$TMPFIL
+ $DIALOG --default-item "$LAST_ITEM" --timeout
$NETENV_TIMEOUT --menu "$CHOOSE_TITLE_TEXT" 20
$COLS 12 "${ITEM_LIST[@]}" 2>$TMPFIL
EXIT_STATUS=$?
if [ X`grep -v ^$ $TMPFIL` = Xtimeout ]; then
if [ X"$NETENV_REMEMBER_LAST" = Xdefault -a
-r /var/cache/netenv/lastitem ]; then
Nobody/Anonymous
None
None
Public
|
Date: 2005-06-04 16:36 Logged In: YES |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use