Wifi script - criticisms welcome

If it doesn't relate to Debian, but you still want to share it, please do it here

Wifi script - criticisms welcome

Postby n_hologram » 2018-02-21 01:34

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...
n_hologram
 
Posts: 433
Joined: 2013-06-16 00:10

Re: Wifi script - criticisms welcome

Postby Argus » 2018-02-21 05:02

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:
Argus
 
Posts: 20
Joined: 2017-12-03 01:19

Re: Wifi script - criticisms welcome

Postby Head_on_a_Stick » 2018-02-21 07:03

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.
User avatar
Head_on_a_Stick
 
Posts: 7900
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Wifi script - criticisms welcome

Postby sunrat » 2018-02-22 15:18

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
sunrat
 
Posts: 2428
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Wifi script - criticisms welcome

Postby golinux » 2018-02-22 15:50

@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!
User avatar
golinux
 
Posts: 1378
Joined: 2010-12-09 00:56
Location: not a 'buntard!

Re: Wifi script - criticisms welcome

Postby n_hologram » 2018-02-22 20:01

@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...
n_hologram
 
Posts: 433
Joined: 2013-06-16 00:10

Re: Wifi script - criticisms welcome

Postby sunrat » 2018-02-22 23:45

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!
User avatar
sunrat
 
Posts: 2428
Joined: 2006-08-29 09:12
Location: Melbourne, Australia

Re: Wifi script - criticisms welcome

Postby n_hologram » 2018-02-23 16:44

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...
n_hologram
 
Posts: 433
Joined: 2013-06-16 00:10


Return to Offtopic

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable