Changes since v1:
- source directly instead of using "command -v" as much as possible,
I couldn't get the sources in deviceprofile cases to return a proper
exit code so they still use "command -v".
- avoid leaving deviceprofile var set in interactive shells from
sxmo_init.sh
- small fixup to warning message if deviceprofile not found
This allows Sxmo to drop an external dependency on which.
Anjan's note: This is also faster due to being a shell built-in
Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
An earlier patch switched us over to busybox rfkill, but didn't
switchover all rfkill instants to use new syntax.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
On most systems, the rfkill states are saved on reboot (see
/etc/init.d/rfkill in alpine, for instance). However, if we
unload the modules, the the rfkill state would not be visible,
and so toggle would not be permanent.
One solution would be to add the modules to blacklist, but that seems
too complicated. The simpler solution is to not unload/load the modules
at all. After all, rfkill should block these modules from running
and/or sucking up battery, nad you really only need to unload the module
if it is buggy. Maybe there's a reason we want to unload the module,
but I think that might be a user decision.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Any sane linux system will have a posix compliant shell at /bin/sh
This change will allow us to better detect running scripts using pgrep.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>