[debian-knoppix] [PATCH] pppoeconf working with Xdialog
Hi,
I've "hacked" the pppoeconf-script a bit to work with Xdialog.
So users will have a smart graphical gui if Xdialog is installed and DISPLAY
is set.
I had to change some things. See attached diff.
Be assured that I have tested it thouroughly.
cu
Fabian
PS: Change from 40 to 60 width in gauge is needed for Xdialog to display whole
Caption.
--- /usr/sbin/pppoeconf 2002-09-28 21:45:43.000000000 +0200
+++ pppoeconf 2003-04-06 14:19:10.000000000 +0200
@@ -11,6 +11,11 @@
# IMPORTANT: Do not use gdialog unless it has been fixed!
DIALOG=whiptail
+# Set up (X)dialog - added by Fabian Franz <knx-ppp@fabian-franz.de>
+XDIALOG_HIGH_DIALOG_COMPAT=1
+export XDIALOG_HIGH_DIALOG_COMPAT
+[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"
+
# SUID wrapper for KNOPPIX added by Klaus Knopper <knoppix@knopper.net>
# mod. by EB
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
@@ -38,7 +43,7 @@
sectempfile="$TMP/$RANDOM"
trap "rm -rf '$TMP'" 0 1 2 5 15
-namehelp=$"
+echo -e $"
Most providers send the needed login information per mail. Some providers describe it in odd ways, assuming the user to input the data in their \"user-friendly\" setup programs. But in fact, these applications generate usuall PPP user names and passwords from the entered data. You can find the real names too and input the correct data in the dialog box.\n\nFor example, this are methods used some german providers:
Sample username (alias \"login\" or \"login name\"): 11111111111
@@ -83,7 +88,7 @@
Webnetix:
complete username: sdt/11111111111
-"
+" > $TMP/namehelp.txt
list=$( LANG=C /sbin/ifconfig -a | grep "Ethernet" | cut -f1 -d" " )
@@ -106,7 +111,7 @@
for iface in $list; do
touch $TMP/pppoe.scan
(pppoe -A -I $iface > $TMP/$iface.pppoe ; rm $TMP/pppoe.scan) &
- ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 6`; echo $time; sleep 1; done ) | $DIALOG --title $"SCANNING DEVICE" --gauge $"Looking for PPPoE Access Concentrator on $iface..." 10 40 0
+ ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 6`; echo $time; sleep 1; done ) | $DIALOG --title $"SCANNING DEVICE" --gauge $"Looking for PPPoE Access Concentrator on $iface..." 10 60 0
done
cd "$TMP"
iface=`grep -l AC eth*.pppoe| cut -f1 -d"." | head -n1`
@@ -162,7 +167,7 @@
case $? in
0)
if test -z "$user" ; then
- $DIALOG --scrolltext --msgbox "$namehelp" 17 75
+ $DIALOG --scrolltext --textbox "$TMP/namehelp.txt" 17 75
else
sed -e 's/^user .*//' $OPTSFILE > "$sectempfile"
mv "$sectempfile" $OPTSFILE
Reply to: