Net-setup-20140422

Configuration wizards, scanners, remote desktop, etc.
Post Reply
Message
Author
User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

Net-setup-20140422

#1 Post by shinobar »

Bugfix and improvement of network-setup scripts by Japanese Forum.
http://shino.pos.to/party/bridge.cgi?pu ... 140422.pet

(OLD)
net-setup-20100310.pet from here.
  1. improved WEP wireless connection with wait which seems required for some hardwares.
  2. proper error messages when connection failed
  3. use one available connection even if multiple interfaces exist
  4. automatical setting in case eth0 and DHCP available
  5. allow manual disconnection and/or re-connection even when Wake-on-lan active.
Original topic:
http://www.murga-linux.com/puppy/viewtopic.php?t=53354
Last edited by shinobar on Tue 17 Jun 2014, 08:16, edited 1 time in total.

User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

Recent woof problem

#2 Post by shinobar »

The rc.sysinit of recent woof, maybe 100216 and later, has a problem in automatic setting with this net-setup.

It calls rc.basic instead of rc.network for the first run.
The /etc/rc.d/rc.sysinit should be modified:

/etc/rc.d/rc.sysinit at line 532- or so

Code: Select all

  *)
  #this only sets up interface 'lo'...
  /etc/rc.d/rc.network_basic &
  ;;
rewrite to: (edited on 28 Jun 2010)

Code: Select all

  *)
  #100628 shinobar: launch rc.network if eth0 is usable
  #this only sets up interface 'lo'...
  RCNETWORK=/etc/rc.d/rc.network_basic
  # eth0 usable?
  /sbin/ifconfig eth0 &>/dev/null && [ -x /etc/rc.d/rc.network ] && RCNETWORK=/etc/rc.d/rc.network
  $RCNETWORK &
  ;;
Or, adding code for Pwireless2 (edited on 3 Jul 2010)

Code: Select all

*)
  #3jul10 shinobar: launch rc.network/Pwireless2 if eth0 is usable
  #this only sets up interface 'lo'...
  RCNETWORK=/etc/rc.d/rc.network_basic
  # eth0 usable?
  if /sbin/ifconfig eth0 &>/dev/null ;then
    if [ -x /etc/rc.d/rc.network ]; then
      RCNETWORK=/etc/rc.d/rc.network
    elif [ -e /etc/init.d/Pwireless2 ]; then
      chmod 755 /etc/init.d/Pwireless2
    fi
  fi
  $RCNETWORK &
 ;;
Last edited by shinobar on Fri 02 Jul 2010, 22:36, edited 3 times in total.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#3 Post by BarryK »

shinobar,
Ok, I have changed rc.sysinit in Woof.
[url]https://bkhome.org/news/[/url]

User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

rc.sysinit

#4 Post by shinobar »

BarryK wrote: I have changed rc.sysinit in Woof.
Thanks Barry.
Concider another improvement of rc.sysinit.
http://www.murga-linux.com/puppy/viewtopic.php?t=57252

EDIT:
as for calling rc.network or Pwireless2,
/etc/rc.d/rc.sysinit at line 493- or so

Code: Select all

 *) #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
 ;;
rewrite:

Code: Select all

 *) #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'
    elif [ -f /usr/local/Pwireless2/interface ]; then
	 NETCHOICE='Pwireless2' #100304
    elif [ -x /etc/rc.d/rc.network ]; then	# 30jun10 shinobar
	 NETCHOICE='net-setup.sh'
	elif [ -x /etc/init.d/Pwireless2 ]; then	# 30jun10 shinobar
	  NETCHOICE='Pwireless2'
    fi
   fi
  fi
 ;;

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post by BarryK »

So on the very first boot, it will default to running net-setup.sh.

I don't want that. SNS is my preferred choice.

The network_tray ion in the tray displays with a big red cross in it at first boot, and mouse-over pops up a message to click the 'connect' icon to make a connection to the Internet. Given that there are many different ways to connect to the Internet, I prefer this manual approach for now.
[url]https://bkhome.org/news/[/url]

User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

net_setup-20140422

#6 Post by shinobar »

UPDATE:
http://shino.pos.to/party/bridge.cgi?pu ... 140422.pet

1. WPA-AES support
2. more wait before scan
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

Re: net_setup-20140422

#7 Post by ASRI éducation »

shinobar wrote:UPDATE:
http://shino.pos.to/party/bridge.cgi?pu ... 140422.pet

1. WPA-AES support
2. more wait before scan
Thank you.
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

gcmartin

#8 Post by gcmartin »

#1
Is this going to WOOF-CE?

#2
Also, if the motherboard has 2 LAN adapters where only 1 (for example eth1) has the active cable to the switch, will this autodetect it?

stemsee

#9 Post by stemsee »

Could dual phase security, as on android devices, be added as an option.

Phase 1 EAP method
PEAP

phase 2
MSCHAPV2

ID
email etc

wpa/2
password

stemsee

#10 Post by stemsee »

Did it myself. Depends on yad. Save in path and make executable.
You simply enter space separated values for ssid (name of wifi network you wish to join) use inverted commas " "; identity (username/email etc) use inverted commas " "; and password (visible) use inverted commas " " too. Works fine as long as phase 1 is PEAP and phase 2 is MSCHAPv2

Code: Select all

#!/bin/sh 
# Script by stemsee, connects a linux system to dual phase security wifi 
# network, and retains details across reboots of last used network. 
# Developed on puppy linux which is always root. 
if [ "$1" = reset ]; then 
rm -f $HOME/.eduwifi 
fi 
rm -f /tmp/wpa_supplicant.conf 
rm -r /var/run/wpa_supplicant/wlan0 
killall dhcpcd 
sleep 1 
if [ -f $HOME/.eduwifi ]; then 
input=`cat $HOME/.eduwifi` 
else 
input=$(yad --width=600 --title "Enter the; network name (space) your id (space) password (space) interface" --entry) 
if [ ! -z "$input" ]; then 
echo "$input" > $HOME/.eduwifi 
else 
exit 0 
fi 
fi 
ssid=`echo "$input" | cut -f1 -d ' '` 
identity=`echo "$input" | cut -f2 -d ' '` 
password=`echo "$input" | cut -f3 -d ' '` 
interf=`echo "$input" | cut -f4 -d ' '` 
echo "ctrl_interface=/var/run/wpa_supplicant 
update_config=1 
fast_reauth=1 
ap_scan=1 

network={ 
    ssid='$ssid' 
    proto=RSN 
    key_mgmt=WPA-EAP 
    pairwise=CCMP 
    eap=PEAP 
    phase2='auth=MSCHAPV2' 
    identity='$identity' 
    password='$password' 
} 
" > /etc/network-wizard/wireless/wpa_profiles/eduroam.conf 
cat /etc/network-wizard/wireless/wpa_profiles/eduroam.conf | tr "'" '"' > /etc/network-wizard/wireless/wpa_profiles/eduroam.conf1 
mv /etc/network-wizard/wireless/wpa_profiles/eduroam.conf1 /etc/network-wizard/wireless/wpa_profiles/eduroam.conf 
wpa_supplicant -Dwext -i "$interf" -c /etc/network-wizard/wireless/wpa_profiles/eduroam.conf -B 
sleep 1 
dhcpcd -L & 
exit 0 

Post Reply