diff options
author | Bruno Randolf <br1@einfach.org> | 2018-08-23 21:59:58 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-08-29 08:31:10 +0200 |
commit | 6b14a73f4f619b7bbdeac1cbcd0d34b0957ca0cb (patch) | |
tree | 280c5b5a7102fe77b6a127dff0588366d27c4d23 | |
parent | 01793e8752aa8211d6d74c92722787c403e5420d (diff) | |
download | mtk-20170518-6b14a73f4f619b7bbdeac1cbcd0d34b0957ca0cb.zip mtk-20170518-6b14a73f4f619b7bbdeac1cbcd0d34b0957ca0cb.tar.gz mtk-20170518-6b14a73f4f619b7bbdeac1cbcd0d34b0957ca0cb.tar.bz2 |
ugps: Add option disabled
Like many other packages, an option to disable can be practical.
Signed-off-by: Bruno Randolf <br1@einfach.org>
-rw-r--r-- | package/utils/ugps/files/gps.config | 1 | ||||
-rw-r--r-- | package/utils/ugps/files/ugps.init | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/package/utils/ugps/files/gps.config b/package/utils/ugps/files/gps.config index d4bd69a..01559f7 100644 --- a/package/utils/ugps/files/gps.config +++ b/package/utils/ugps/files/gps.config @@ -1,3 +1,4 @@ config gps option 'tty' 'ttyACM0' option 'adjust_time' '1' + option 'disabled' '1' diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init index 157043c..3cd1ca1 100644 --- a/package/utils/ugps/files/ugps.init +++ b/package/utils/ugps/files/ugps.init @@ -13,6 +13,9 @@ service_triggers() { start_service() { local tty="$(uci get gps.@gps[-1].tty)" local atime="$(uci get gps.@gps[-1].adjust_time)" + local disabled="$(uci get gps.@gps[-1].disabled || echo 0)" + + [ "$disabled" == "0" ] || return [ -c "$tty" ] || { tty="/dev/$tty" |