home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #Barry Kauler www.puppyos.com
-
- DEFAULTCONNECT="`cat /usr/local/bin/defaultconnect | tail -n 1 | tr -s " " | cut -f 2 -d " "`"
- #radiobuttons...
- DEFGNOMEPPP="no"
- DEFGKDIAL="no"
- DEFPPPOE="no"
- DEFICW="no"
- case $DEFAULTCONNECT in
- gnome-ppp)
- DEFGNOMEPPP="yes"
- ;;
- gkdial)
- DEFGKDIAL="yes"
- ;;
- tkpppoe)
- DEFPPPOE="yes"
- ;;
- *)
- DEFICW="yes"
- ;;
- esac
-
- MSGMODEM="coming soon..."
- if [ -e /dev/modem ];then
- DEVMODEM="`readlink /dev/modem`"
- MSGMODEM="A modem is detected at $DEVMODEM"
- fi
-
- FLAGGNOMEPPP=""
- if [ ! "`which gnome-ppp`" = "" ];then
- FLAGGNOMEPPP="<radiobutton><label>GnomePPP (modem dialup)</label><variable>RADIOGNOMEPPP</variable><default>$DEFGNOMEPPP</default></radiobutton>"
- fi
-
- WizardWizard="
- <wtitle>Internet Connection Wizard</wtitle>
- <vbox>
- <frame Current setup/status>
- <text>
- <label>$MSGMODEM</label>
- </text>
- </frame>
- <frame Connect>
- <hbox>
- <text>
- <label>Connect to Internet by dialup analog modem...</label>
- </text>
- <button>
- <input file>/usr/local/lib/X11/mini-icons/wizard16.xpm</input>
- <action>/usr/sbin/modem-wizard</action>
- <action>/usr/local/bin/gkdial &</action>
- <action>exit</action>
- </button>
- </hbox>
- <hbox>
- <text>
- <label>Connect to Internet by wired ethernet interface...</label>
- </text>
- <button>
- <input file>/usr/local/lib/X11/mini-icons/wizard16.xpm</input>
- <action>/usr/sbin/net-setup.sh &</action>
- <action>exit</action>
- </button>
- </hbox>
- <hbox>
- <text>
- <label>Connect to Internet by wireless interface...</label>
- </text>
- <button>
- <input file>/usr/local/lib/X11/mini-icons/wizard16.xpm</input>
- <action>/usr/sbin/wirelesswizard &</action>
- <action>exit</action>
- </button>
- </hbox>
- </frame>
- <frame Tools>
- <hbox>
- <text>
- <label>Setup a firewall...</label>
- </text>
- <button>
- <input file>/usr/local/lib/X11/mini-icons/wizard16.xpm</input>
- <action>rxvt -e /usr/sbin/firewallinstallshell &</action>
- <action>exit</action>
- </button>
- </hbox>
- </frame>
- <frame Desktop 'connect' icon>
- <vbox>
- $FLAGGNOMEPPP
- <radiobutton><label>Gkdial (modem dialup)</label><variable>RADIOGKDIAL</variable><default>$DEFGKDIAL</default></radiobutton>
- <radiobutton><label>Roaring Penguin (PPPoE)</label><variable>RADIOPPPOE</variable><default>$DEFPPPOE</default></radiobutton>
- <radiobutton><label>Internet Connection Wizard</label><variable>RADIOICW</variable><default>$DEFICW</default></radiobutton>
- </vbox>
- </frame>
- <hbox>
- <button ok></button>
- </hbox>
- </vbox>
- "
-
- RETSTR="`echo "$WizardWizard" | gtkdialog2 --stdin`"
- #gtkdialog --program=WizardWizard
-
- RADIOBUT="`echo "$RETSTR" | grep '^RADIO' | grep '"true"' | cut -f 1 -d '='`"
- [ "$RADIOBUT" = "RADIOGNOMEPPP" ] && echo -e '#!/bin/sh\nexec gnomepppshell' > /usr/local/bin/defaultconnect
- [ "$RADIOBUT" = "RADIOGKDIAL" ] && echo -e '#!/bin/sh\nexec gkdial' > /usr/local/bin/defaultconnect
- [ "$RADIOBUT" = "RADIOPPPOE" ] && echo -e '#!/bin/sh\nexec tkpppoe' > /usr/local/bin/defaultconnect
- [ "$RADIOBUT" = "RADIOICW" ] && echo -e '#!/bin/sh\nexec connectwizard' > /usr/local/bin/defaultconnect
-
- ###end###
-