-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optionally run iiab-network when wifi is present #175
base: master
Are you sure you want to change the base?
Conversation
in support of iiab/iiab#2876 |
I'm not clear on the relationship between iiab-install and iiab-complete. |
@@ -429,6 +429,11 @@ fi | |||
|
|||
touch $FLAGDIR/iiab-complete | |||
|
|||
if ! [[ $(ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc ) == 0 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the suggestion (further below) also work?
If so, it suppresses this error on non-WiFi systems:
root@box:~# ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory
0 0 0
root@box:~# ls -la /sys/class/net/*/phy80211
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory
FWIW 2>/dev/null
would also work below, if preserving STDOUT is desired:
if ! [[ $(ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}' | wc ) == 0 ]]; then | |
if ls /sys/class/net/*/phy80211 &>/dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be useful to know why iiab-network is not being run, lack of phy80211 in any of the interfaces...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this PR does not display STDOUT e.g. network devices like ap0 and wlan0.
If you want to display both STDOUT and STDERR, here's one rudimentary (bare bones) option:
if ls -d1 /sys/class/net/*/phy80211; then
When run, it shows stuff like...
root@box:~# if ls -d1 /sys/class/net/*/phy80211; then :; fi
/sys/class/net/ap0/phy80211
/sys/class/net/wlan0/phy80211
root@box:~# if ls -d1 /sys/class/net/*/phy80211; then :; fi
ls: cannot access '/sys/class/net/*/phy80211': No such file or directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note that this PR's original if
statement always returns True.
That aspect can be fixed with wc -l
instead of wc
.
However that's not a comprehensive fix, as it still does not display STDOUT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really care what the syntax you decide to push is just make it happen so users that use the 'iiab' script outside of the intended target of supporting offline wifi serving of web content can continue to muck around without bothering to read any of the docs, reducing frivolous requests for support of their local network layout.
I'm not sure why the ka-lite routines are here in the 'iiab' script and not the kalite role so that sort of muddles things up also.. I used iiab-complete as shorthand to signify that all available options (ansible, iiab-install, admin-console, kalite manage/content ) were run during the execution of the iiab script. |
The reason is that downloading KA Lite's mandatory ~1GB So roles/kalite is intentionally separated from this more fragile and time-consuming step (which happens near the very end of IIAB's install script). |
The only time the network role is really needed is with wifi present otherwise the install is just using the os provided networking.