Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Wifi script - criticisms welcome

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
n_hologram
Posts: 459
Joined: 2013-06-16 00:10

Wifi script - criticisms welcome

#1 Post by n_hologram »

Hey all,

I wrote this rudimentary wifi "manager" (assistant, maybe?) as way to avoid traditional ones, like networkmanager and wicd, due to specific (personal) needs and uses. I'm painfully new to github, and only made this git page to house some common scripts I use from Linux-to-Linux systems, so it's certainly nothing hyper-professional. I just thought I'd share for anyone who is interested, and seek advice as well.

Upsides: insignificant resource usage; uses network/interfaces.d directly; shell script can be modified to add specific needs, like openvpn or macchanger, without unnecessary intrusion (eg, rfkill); and stores network information as files in a common directory (/etc/wpa).

Downsides: currently, no daemon for auto-switching on network change (auto-switching for available networks is a WIP); probably isn't newbie-friendly at all; surely there is at least one or ten unknown issues; doesn't grind coffee beans in the morning. Also, I'm using sysv, so I have no idea what would and woudn't break in systemd.

Constructive criticism welcome and invited.

https://github.com/souperdoupe/crunkbon ... fe-netdude
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
the crunkbong project: scripts, operating system, the list goes on...

Argus
Posts: 20
Joined: 2017-12-03 01:19

Re: Wifi script - criticisms welcome

#2 Post by Argus »

Hey; this looks nice! I'll check it out when I have time. I really like super simple utilities like this.
Maybe I'll post my own such projects / scripts and we can all share and contribute to eachother, as is the open-source way :mrgreen:

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Wifi script - criticisms welcome

#3 Post by Head_on_a_Stick »

Thanks for this, I love these connection scripts :)

I will try it out tonight...

You may want to consider using wpa_supplicant directly (with a dhcp client or static IPs) instead of /etc/network/interfaces — it would be distribution-agnostic and the wpa_supplicant configuration file will automatically switch to the best available network.

Have you seen grml's connection script?

http://deb.grml.org/pool/main/g/grml-network/

I think it needs their core functions as well: http://deb.grml.org/pool/main/g/grml-etc-core/

I use it in my live ISO image and it is most excellent.

There is also TinyCore's cheeky little POSIX script:

https://gist.githubusercontent.com/Head ... ce/wifi.sh

EDIT: you need their tc-functions for that one to work, perhaps crack open one of their ISO images to obtain them.
deadbang

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Wifi script - criticisms welcome

#4 Post by sunrat »

Is this better than Ceni? it's Antix default network manager and should work in Stretch. siduction also uses it but I'm not sure if Stretch would have the right dependencies although Sid should.
http://download.tuxfamily.org/antix/doc ... Q/net.html
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
golinux
Posts: 1579
Joined: 2010-12-09 00:56
Location: not a 'buntard!
Been thanked: 1 time

Re: Wifi script - criticisms welcome

#5 Post by golinux »

@n_hologram . . . Good for you to make it "your way"! You might also want to look at KatolaZ' setnet which you can find here or in the devuan repos. Might be something useful for you in the way he does things. As for me . . . wicd works ootb so allows me to do other things. ;)
May the FORK be with you!

n_hologram
Posts: 459
Joined: 2013-06-16 00:10

Re: Wifi script - criticisms welcome

#6 Post by n_hologram »

@argus: I'll bet a shell-script megathread would be eye-opening for a lot of post-novice members!

@HoaS: Ironically, the first iteration of the script used wpasupplicant :) #greatminds. The only issue I faced was, when wpa_passphrase generates its own config file, I realized there's no room for extra options; and if I had to trim the fat anyways, network/interfaces seemed more sensible. I'll revisit that one, though.

Also, I like grml's network configurator. I'll have to peruse the source code sometime; never thought about dropping it in a custom spin.

@sunrat: "better" is subjective. I wanted a utility that balanced simplicity with efficiency -- ie, passing a simple command-line argument to connect to a network -- and also one that is simple enough to easily augment (eg, writing a quick, streamlined daemon for basic autoconnection, if that's desirable) without weird issues that I've noticed other network managers tend to spit-out, like rfkill intrusion. ceni is legit, and I actually cited it a point to acknowledge it as one of the inspirations, since managing interfaces is one of its major tasks; however, it's also not a mere 91 lines of code... ;)

@golinux: that is one intense script! I'll try it out tonight. I'm already getting a few ideas.
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
the crunkbong project: scripts, operating system, the list goes on...

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Wifi script - criticisms welcome

#7 Post by sunrat »

n_hologram wrote:@sunrat: "better" is subjective...., it's also not a mere 91 lines of code... ;)
Sorry, I didn't mean to sound negative. Should have said "how does it differ from..." 91 lines is indeed impressive.

Ceni uses ncurses and perl so I guess is not a purely shell script. And I had to look - 1679 lines including 200 blank ones. :)
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

n_hologram
Posts: 459
Joined: 2013-06-16 00:10

Re: Wifi script - criticisms welcome

#8 Post by n_hologram »

I didn't take it offensively :) I only wanted to avoid setting high expectations.

Interestingly, I tried the original script on another system, and it didn't work. This is a bit embarrassing...
EDIT: Fixed, had some things misquoted.

I did take HaoS' advice and made a separate variant based on wpasupplicant, with its own separate install script and config folder, and that one DID work on the other system, so I assume it's good to go. Testers welcome.
bester69 wrote:There is nothing to install in linux, from time to time i go to google searching for something fresh to install in linux, but, there is nothing
the crunkbong project: scripts, operating system, the list goes on...

Post Reply