Check-in [ff65be12cd]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:ff65be12cd6899d5bf9c47238848d7b01d62fe36
Date: 2013-02-08 10:33:00
User: root
Comment:rerwin: infrastructure to support Frisbee and dropwait feature of dhcpcd. refer forum t=82092&start=300

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/local/apps/Connect/AppRun

@@ -1,20 +1,21 @@
 #!/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'.
 #110505 support sudo for non-root user.
+#130104 rerwin: add frisbee
+#130117 rerwin: remove redundant CURREXEC test, per shinobar
 
 [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505
 
 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
@@ -24,16 +25,20 @@
    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
+     CHECKFRISBEE="`ls -1 /etc/frisbee/interfaces 2>/dev/null`" #130104...
+     if [ "$CHECKFRISBEE" != "" ];then
+      NETCHOICE='frisbee'
+     else #130104 end
+      [ -f /usr/local/Pwireless2/interface ] && NETCHOICE='Pwireless2' #100304
+     fi
     fi
    fi
   fi
   [ "$NETCHOICE" != "" ] && CURREXEC="$NETCHOICE"
- fi
 fi
 #16aug10 shinobar: end
 
 RUNMODE="$1"
 
@@ -47,10 +52,11 @@
     pppoe_gui) pppoe_gui ;;
     connectwizard) connectwizard ;;
     Pwireless2) Pwireless2 ;;
     net_wiz_classic) net_wiz_classic ;;
     sns) /usr/local/simple_network_setup/rc.network ;;
+    frisbee) [ -f /usr/local/bin/frisbee ] && /usr/local/frisbee/connect ;; #130104
    esac
    ;;
   --disconnect) #disconnect using default tool.
    case $CURREXEC in
     net-setup.sh)  exec /etc/rc.d/rc.network stop 1>&2 ;; #Dougal.
@@ -59,11 +65,12 @@
     pppoe_gui) pppoe_gui ;;
     connectwizard) connectwizard ;;
     Pwireless2) Pwireless2 ;;
     net_wiz_classic) net_wiz_classic ;;
     sns) /usr/local/simple_network_setup/rc.network stop ;;
+    frisbee) [ -f /usr/local/bin/frisbee ] && /usr/local/frisbee/disconnect ;; #130104
    esac
    ;;
   *) exec /usr/local/bin/defaultconnect 1>&2  ;;
 esac
 
 ###END###

Changes to woof-code/rootfs-skeleton/usr/local/simple_network_setup/rc.network

@@ -12,10 +12,11 @@
 #100804 while testing for module loaded, also test for valid macaddress.
 #101122 wait for module to load.
 #101216 more logging, to /tmp/simple_network_setup.
 #110203 improve scanning.
 #120204 BK: internationalized.
+#121117 rerwin: Add dropwait option to dhcpcd startup.
 
 export TEXTDOMAIN=sns___rc.network
 export OUTPUT_CHARSET=UTF-8
 LANGORIG=$LANG
 
@@ -99,10 +100,12 @@
 #[ $IF_NUM -eq 0 ] && exit
 
 INTERFACES="`ifconfig -a | grep -F 'Link encap:Ethernet' | cut -f1 -d' ' | tr '\n' ' '`"
 
 ##########WIRELESS##########
+#121117 form dropwait argument for dhcpcd...
+DROPWAIT="$(dhcpcd_dropwait_option)"
 echo -n "" > /tmp/simple_network_setup/rc_network_wireless_connection_log
 grep '|Wireless|' /tmp/sns_connections_available > /tmp/sns_connections_wireless
 for INTERFACE in $INTERFACES #exs: wlan0 eth0
 do
  [ ! -d /sys/class/net/${INTERFACE}/wireless ] && continue #only want wireless.
@@ -182,11 +185,11 @@
         #[ "`wpa_cli -i $INTERFACE status | grep 'COMPLETED'`" != "" ] && break
         wCNT=$(($wCNT + 1))
        done
       fi
      fi
-     [ $wCNT -le 20 ] && dhcpcd $DHCPCDFIX $INTERFACE #100320
+     [ $wCNT -le 20 ] && dhcpcd $DHCPCDFIX $DROPWAIT $INTERFACE #100320 121115
     fi
     MODTIME2="`stat --format=%Y /etc/resolv.conf`"
     [ "`grep -v '^#' /etc/resolv.conf`" == "" ] && MODTIME2=$MODTIME1 #fail.
     if [ "$MODTIME2" != "$MODTIME1" ];then
      echo "     SUCCESS" >> /tmp/simple_network_setup/rc_network_wireless_connection_log

Changes to woof-code/rootfs-skeleton/usr/local/simple_network_setup/sns

@@ -24,10 +24,11 @@
 #120107 gtkdialog3 to gtkdialog4, new 'Profile' frame in main window, new profiles help window.
 #120204 rodin.s: internationalized.
 #120222 small change to 'connect now' button.
 #120323 replace remaining 'xmessage' with 'pupmessage'.
 #120324 fix syntax error gettext.
+#121117 rerwin: add dropwait option to dhcpcd startup. see also rc.network.
 
 export TEXTDOMAIN=sns___sns
 export OUTPUT_CHARSET=UTF-8
 . gettext.sh
 
@@ -608,11 +609,11 @@
        for iterDHCPCD in a b #100320
        do
         [ "$iterDHCPCD" = "a" ] && DHCPCDFIX=""
         [ "$iterDHCPCD" = "b" ] && DHCPCDFIX="-I ''" #some dhcp servers require empty Client ID (default is macaddress).
         echo "STEP6${iterDHCPCD}: dhcpcd $DHCPCDFIX $INTERFACE" >> /tmp/sns_wireless_log
-        dhcpcd $DHCPCDFIX $INTERFACE >> /tmp/sns_wireless_log 2>&1 ####DHCP CLIENT####
+        dhcpcd $DHCPCDFIX $(dhcpcd_dropwait_option) $INTERFACE >> /tmp/sns_wireless_log 2>&1 ####DHCP CLIENT#### 121117
         mCNT=0
         while [ 1 ];do
          MODTIME2="`stat --format=%Y /etc/resolv.conf`"
          [ "$MODTIME2" != "$MODTIME1" ] && break 2
          sleep 1

Changes to woof-code/rootfs-skeleton/usr/sbin/connectwizard

@@ -19,10 +19,12 @@
 #111028 put hostname entry box directly in this wizard. internationalised.
 #111106 do not use $HOSTNAME, as hostname-set may have just been run.
 #120201 one gettext translation added.
 #120823 rerwin: add frisbee.
 #120823 rerwin: get correct pid in wait loop.
+#121112 rerwin: change indicator of frisbee.
+#130111 rerwin: change name of frisbee invocation for integrated version, add disable when appropriate.
 
 export TEXTDOMAIN=connectwizard
 export OUTPUT_CHARSET=UTF-8
 
 GTKDIALOGEXE="gtkdialog"
@@ -61,11 +63,11 @@
   DEFPPPOECONF="yes"
   ;;
  Pwireless2) #100227
   DEFPWIRELESS="yes"
   ;;
- Frisbee) #120823
+ frisbee) #120823 130111
   DEFFRISBEE="yes"
   ;;
  net_wiz_classic) #100227
   DEFNETWIZCLASSIC="yes"
   ;;
@@ -203,11 +205,11 @@
 if [ -d /usr/local/Pwireless2 ];then #100227 Jemimah's wireless connection gui.
  FLAGPWIRELESS="<radiobutton><label>${M_pw1}</label><variable>RADIOPWIRELESS</variable><default>$DEFPWIRELESS</default></radiobutton>"
 fi
 
 M_fr1=$(gettext "Frisbee (wireless networking)")
-if [ -f /usr/local/Frisbee/func ];then #100227 Jemimah's wireless connection gui.
+if [ -f /usr/local/bin/frisbee ];then #100227 121112 130111 Jemimah's wireless connection gui.
  FLAGFRISBEE="<radiobutton><label>${M_fr1}</label><variable>RADIOFRISBEE</variable><default>$DEFFRISBEE</default></radiobutton>"
 fi
 
 M_nwc1=$(gettext "Network Wizard Classic")
 if [ -f /usr/local/net_setup/usr/sbin/net-setup.sh ];then #100227 wizard used in older puppies.
@@ -375,11 +377,16 @@
 [ "$RADIOBUT" = "RADIORPPPPOE" ] && echo -e '#!/bin/sh\nexec pppoe_gui' > /usr/local/bin/defaultconnect
 [ "$RADIOBUT" = "RADIOMTGPRS" ] && echo -e '#!/bin/sh\nexec rxvt -title "pgprs-connect PRESS CTRL+C TO DISCONNECT" -e pgprs-connect' > /usr/local/bin/defaultconnect
 [ "$RADIOBUT" = "RADIOICW" ] && echo -e '#!/bin/sh\nexec connectwizard' > /usr/local/bin/defaultconnect
 [ "$RADIOBUT" = "RADIOPPPOECONF" ] && echo -e '#!/bin/sh\nexec pppoeconf' > /usr/local/bin/defaultconnect #v409
 [ "$RADIOBUT" = "RADIOPWIRELESS" ] && echo -e '#!/bin/sh\nexec Pwireless2' > /usr/local/bin/defaultconnect #100227
-[ "$RADIOBUT" = "RADIOFRISBEE" ] && echo -e '#!/bin/sh\nexec Frisbee' > /usr/local/bin/defaultconnect #120823
+[ "$RADIOBUT" = "RADIOFRISBEE" ] && echo -e '#!/bin/sh\nexec frisbee' > /usr/local/bin/defaultconnect #120823 130111
 [ "$RADIOBUT" = "RADIONETWIZCLASSIC" ] && echo -e '#!/bin/sh\nexec net_wiz_classic' > /usr/local/bin/defaultconnect #100227
 [ "$RADIOBUT" = "RADIONETWIZARD" ] && echo -e '#!/bin/sh\nexec net-setup.sh' > /usr/local/bin/defaultconnect #100227
 [ "$RADIOBUT" = "RADIOSNS" ] && echo -e '#!/bin/sh\nexec sns' > /usr/local/bin/defaultconnect #100227
+
+if [ "$FLAGFRISBEE" ];then #130111 precaution...
+ echo -n "$RADIOBUT" | grep -q -E 'CW$|FRISBEE|PUPDIAL|MTGPRS' \
+  || frisbee_mode_disable
+fi
 
 ###end###

Changes to woof-code/rootfs-skeleton/usr/sbin/connectwizard_2nd

@@ -4,10 +4,13 @@
 #called from 'connectwizard'
 #choose between old Network Wizard, new Network Wizard and Pwireless2.
 #100227 BK initial creation of script.
 #100306 added Barry's Simple Network Setup. 100810 moved SNS to top choice, improved messages.
 #120201 rodin.s: internationalized.
+#121029 01micko, rerwin: added/integrated Frisbee.
+#121122 rerwin: change indicator of frisbee; ensure frisbee stopped if not chosen.
+#130103 rerwin: change name of frisbee invocations for integrated version.
 
 export TEXTDOMAIN=connectwizard_2nd
 export TEXTDOMAINDIR=/usr/share/locale
 export OUTPUT_CHARSET=UTF-8
 . gettext.sh
@@ -35,10 +38,25 @@
    <text><label>$(gettext 'This is a tool developed by Jemimah. Mostly for wireless connectivity for laptops, but also can handle ethernet connection. Very good for wireless roaming. Under very active development (see forum).')</label></text>
    <vbox>
    <button>
     <input file>/usr/local/lib/X11/mini-icons/pc-2x.xpm</input>
     <action type=\"exit\">FLAGPWIRELESS</action>
+   </button>
+   </vbox>
+  </hbox>
+  </frame>
+"
+fi
+
+FRISBEE="" #121029...
+if [ -f /usr/local/bin/frisbee ];then #Jemimah's wireless connection gui. 121122 130103
+ FRISBEE="<frame Frisbee>  <hbox>
+   <text><label>$(gettext 'This is a tool developed by Jemimah. Mostly for wireless connectivity for laptops, but also can handle ethernet connection. Very good for wireless roaming.')</label></text>
+   <vbox>
+   <button>
+    <input file>/usr/local/lib/X11/mini-icons/pc-2x.xpm</input>
+    <action type=\"exit\">FLAGFRISBEE</action>
    </button>
    </vbox>
   </hbox>
   </frame>
 "
@@ -79,33 +97,42 @@
 <vbox>
  <text><label>$(gettext 'This build of Puppy has the following choices of GUI tool that you can use to connect to a network (and Internet)...')</label></text>
 
  ${SNS}
  ${PWIRELESS}
+ ${FRISBEE}
  ${NETWIZARD}
  ${NETWIZCLASSIC}
 
  <hbox>
   <button cancel></button>
  </hbox>
 </vbox>
 </window>
-"
+" #121029
 
 RETSTRING="`gtkdialog3 --program=MAIN_DIALOG --center`"
 #[ "`echo "$RETSTRING" | grep 'EXIT' | grep 'OK'`" = "" ] && return
 #gtkdialog3 --program=MAIN_DIALOG --center
 
 if [ "`echo "$RETSTRING" | grep '^EXIT' | grep 'FLAG'`" != "" ];then
  CHOSENWIZ="`echo "$RETSTRING" | grep '^EXIT' | grep 'FLAG' | cut -f 2 -d '"'`" #'geany
+ if [ "$FRISBEE" ];then #130103...
+  [ "$CHOSENWIZ" != "FLAGFRISBEE" ] && frisbee_mode_disable
+ fi
  case $CHOSENWIZ in
   FLAGPWIRELESS) #Pwireless2
    chmod 755 /etc/init.d/Pwireless2 #100304
    /etc/init.d/Pwireless2 start #100304
    /usr/local/bin/Pwireless2 > /dev/null 2>&1
    NWEXEC='Pwireless2'
    NWCHOICE="Jemimah's Pwireless2"
+  ;;
+  FLAGFRISBEE) #121029
+   /usr/local/bin/frisbee > /dev/null 2>&1 #130103
+   NWEXEC='frisbee' #130103
+   NWCHOICE="Jemimah's Frisbee"
   ;;
   FLAGNETWIZARD) #net-setup.sh
    /usr/sbin/net-setup.sh > /dev/null 2>&1
    NWEXEC='net-setup.sh'
    NWCHOICE="Dougal's Network Wizard"
@@ -137,10 +164,13 @@
   [ "`grep 'gprs' /usr/local/bin/defaultconnect`" != "" ] && CURREXEC='pgprs-connect'
   [ "$CURREXEC" = "gkdial" ] && CURREXEC="pupdial" #for older pups.
   case $CURREXEC in
    Pwireless2)
     CURRCHOICE="Jemimah's Pwireless2"
+   ;;
+   frisbee) #121029 130103
+    CURRCHOICE="Jemimah's Frisbee"
    ;;
    net-setup.sh)
     CURRCHOICE="Dougal's Network Wizard"
    ;;
    net_wiz_classic)

Changes to woof-code/rootfs-skeleton/usr/sbin/dhcpcd_dropwait_option

@@ -1,1 +1,12 @@
+#!/bin/sh
+#GPL3 license (refer /usr/share/doc/legal).
+#usage ex: see /usr/local/simple_network_setup/rc.network, sns.
+#121118 rerwin: script created.
 
+#Form dropwait argument for dhcpcd, for option to delay abandonment of an intermittant connection.  Returns null or (e.g.) -j 15
+DWOPTION="$(dhcpcd --help | grep -o '\-. dropwait' | cut -f 1 -d ' ')"
+DWSECS="$(grep -o '^[0-9]*' /etc/dhcpcd_dropwait_secs 2>/dev/null)"
+[ -n "$DWOPTION" -a -n "$DWSECS" ] \
+ && DROPWAIT="${DWOPTION} ${DWSECS}" || DROPWAIT=""
+echo -n "$DROPWAIT"
+exit 0