This post was being written while the O.P. was writing his "solved" post. Which is how the posts got out of order here, the O.P. types faster than I do.
Originally Posted by lsi
I have read that one before...
As written, it opens port 22 for the network device wlan0 (usually the Wifi, unless renamed in a udev rule).
In fact, it adds that rule regardless of the action to be taken (adding or removing) the usb networking entry from the launcher menu; without
checking if that iptables rule already exists.
Which can lead to multiple copies of the same firewall rule in iptables, one copy for each time this script was run. Not harmful, just a bit messy.
Whereas the usb networking would be network device usb0 (unless renamed somewhere in the device scripting - such as with the udev rules).
So once this script has been run (conditions set to add the usbnetworking to the lanucher menu)....
Then there should be an entry in your launcher menu to turn on (start the ssh daemon) and diddle the firewall rule in iptables for device usb0.
Check in your launcher menu for the usbnetworking menu entry, turn it on.
If the "-i wlan0" argument to that iptables rule was removed, then port 22 would always be open in the firewall for any
device rather than only the specified interface "-i" device.
Since the addition of the iptables rule is in both sides of the condition statement, then it could be outside of the condition statement.
And since it is never removed - made part of the package installation (complete with a check to see if another package has already added the rule or the general rule without the interface device specification).
Again, not harmful, just a bit messy to be diddling a rule for wlan0 in a script for installing access to the usb0 interface device.