Network connect/disconnect

Shinobar posted about a problem with the disconnect/reconnect in the right-click menu of the 'connect' icon on the desktop (and in the network tray icon -- network_tray) when /etc/rc.d/c.sysinit launched rc.network and made an automatic connection on eth0.

Shinobar modified /usr/local/apps/Connect/AppRun:

http://murga-linux.com/puppy/viewtopic.php?t=58978&start=15

I have implemented it with a slight modification:

#!/bin/sh

#100228 BK support default network tool.
#100325 BK support Simple Network Setup.
#16aug10 shinobar: netchoice. BK: but only if defaultconnect still set to 'exec connectwizard'.

CURREXEC="`cat /usr/local/bin/defaultconnect | tail -n 1 | tr -s " " | cut -f 2 -d " "`"
[ "`grep 'gprs' /usr/local/bin/defaultconnect`" != "" ] && CURREXEC='pgprs-connect'
[ "$CURREXEC" = "gkdial" ] && CURREXEC="pupdial" #for older pups.

#16aug10 shinobar: netchoice... same code in rc.init
if [ "$CURREXEC" = "connectwizard" ];then #BK
if ! echo "net-setup.sh pgprs-connect pupdial pppoe_gui Pwireless2 net_wiz_classic sns" | grep -qw "$CURREXEC" ; then
NETCHOICE=""
#try determine which tool was used to setup networking...
if [ -s /etc/simple_network_setup/connections ];then #100306
NETCHOICE='sns'
else
CHECKOLDWIZ="`ls -1 /etc/*[0-9]mode 2>/dev/null`" #ex: eth0mode, wlan0mode.
if [ "$CHECKOLDWIZ" != "" -a -d /usr/local/net_setup ];then
NETCHOICE='net_wiz_classic'
else
CHECKNEWWIZ="`ls -1 /etc/network-wizard/network/interfaces 2>/dev/null`"
if [ "$CHECKNEWWIZ" != "" ];then
NETCHOICE='net-setup.sh'
else
[ -f /usr/local/Pwireless2/interface ] && NETCHOICE='Pwireless2' #100304
fi
fi
fi
[ "$NETCHOICE" != "" ] && CURREXEC="$NETCHOICE"
fi
fi
#16aug10 shinobar: end

etc...



Posted on 7 Oct 2010, 8:49


No comments posted yet.