aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2018-08-23 21:59:58 +0100
committerJohn Crispin <john@phrozen.org>2018-08-29 08:32:33 +0200
commit011e7cb5feab8e44257312ba1a8631e747e57c21 (patch)
treeec1743429c7411a3678adf914d77671cc0992088 /package
parentdef9d215ac7dc682bfb5489bc75d64a2f8af694d (diff)
downloadupstream-011e7cb5feab8e44257312ba1a8631e747e57c21.tar.gz
upstream-011e7cb5feab8e44257312ba1a8631e747e57c21.tar.bz2
upstream-011e7cb5feab8e44257312ba1a8631e747e57c21.zip
ugps: Add option disabled
Like many other packages, an option to disable can be practical. Signed-off-by: Bruno Randolf <br1@einfach.org> (cherry picked from commit 6b14a73f4f619b7bbdeac1cbcd0d34b0957ca0cb)
Diffstat (limited to 'package')
-rw-r--r--package/utils/ugps/files/gps.config1
-rw-r--r--package/utils/ugps/files/ugps.init3
2 files changed, 4 insertions, 0 deletions
diff --git a/package/utils/ugps/files/gps.config b/package/utils/ugps/files/gps.config
index d4bd69afff..01559f7a9c 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 157043cc28..3cd1ca1b8d 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"