LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-09-2022, 08:07 AM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,407

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
A wifi PITA


Slackware-15.0, kernel 5.15.27 on a medium weight x86_64 box here.

I'm doing stuff with my connection so I have this script below in place of /etc/rc.d/rc.inet1. It was working fine until I started using this Ralink 5370 wifi dongle
Code:
bash-5.1$ sudo lsusb
Password:  
Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
A dodgy chip, I know. But it has a kernel driver. Now it fails on bootup, bud if I restart the network, it comes up fine. Why the double-take on startup? Here's the script with the line doing the work in bold:
Code:
#!/bin/sh
# With thanks to montagdude

function print_usage ()
{
  echo "Usage: rc.inet_mine start|stop|restart"
}

function inet_start ()
{
  /sbin/ip address flush dev  wlan1
  /sbin/ip link set wlan1 down
  /sbin/ip link set wlan1 up
#  /sbin/dhcpcd eth1
  /usr/sbin/wpa_supplicant -B   -i wlan1 -c /etc/wpa_supplicant.conf && /sbin/dhcpcd  wlan1 
  /usr/bin/protonvpn connect --cc IE

#  In case I have to set up eth0 some day
#  /sbin/ip address add 192.168.88.9/24 dev wlan0
#  /sbin/ifconfig wlan0 192.168.88.9 netmask 255.255.255.0
#  /sbin/ip route add default via 192.168.88.1
#  arp -s 192.168.88.1 xx:xx:xx:xx:xx:xx(bridge MAC address)
}

function inet_stop ()
{
  /usr/bin/protonvpn d
  /bin/killall wpa_supplicant
  /sbin/dhcpcd -k wlan1
  /sbin/ip link set wlan1 down 
#  In case I have to set up eth0 some day
#  /sbin/ifconfig eth0 down
#  ip route del default via 192.168.88.1
}

if [ $# -lt 1 ]; then
  print_usage
  exit 1
fi

case $1 in
    start)
        inet_start
        ;;
    stop)
        inet_stop
        ;;
    restart)
        inet_stop
        inet_start
        ;;
    *)
        print_usage
        exit 1
        ;;
esac
 
Old 07-10-2022, 01:27 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,407

Original Poster
Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
Thanks for all the many replies, Guys - not!

Solved it. I figured I was asking the dodgy usb wifi chip to do something uncomfortable. This solved it.
Code:
#!/bin/sh
# With thanks to montagdude

function print_usage ()
{
  echo "Usage: rc.inet_mine start|stop|restart"
}

function inet_start ()
{
  /sbin/ip address flush dev  wlan1
#  /sbin/ip link set wlan1 down  ### Commenting out this line fixed it from power up
  /sbin/ip link set wlan1 up
  /usr/sbin/wpa_supplicant -B   -i wlan1 -c /etc/wpa_supplicant.conf && /sbin/dhcpcd  wlan1 
  /usr/bin/protonvpn connect --cc IE …
The restart does a stop (which brings wlan1 down) and then starts it again. The line was redundant, and possibly detrimental.

Mind you, trying to mind read these dodgy usb dongles brings me back to my misspent youth fixing Italian motorbikes. Beautiful to look at, offering bursts of speed inevitably followed by mechanical disaster with a dearth of spares and the most insane problems. I bluffed my way into a mechanic's job fixing real bikes with my hard-won experience.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is K3B always such a PITA ??? bigjohn Linux - Software 5 08-20-2005 01:34 PM
nuisance error(s)/PITA ??? bigjohn Debian 9 05-08-2005 03:49 PM
Installing software is a PITA with linux!! m3s3lf Linux - Newbie 14 12-15-2004 04:20 AM
PITA desktop icons (xawtv) ssevenup Mandriva 5 11-17-2004 11:14 PM
bind is a pita.... trey85stang Linux - Networking 2 07-14-2004 07:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration