aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/samba36/files
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-12-30 07:54:53 +0100
committerRafał Miłecki <rafal@milecki.pl>2020-03-21 22:35:45 +0100
commit8c33debb528919abdb11abd7561538abb57b875b (patch)
tree024416f9d153733076a8fd9c210828749b048d4d /package/network/services/samba36/files
parent8abefc8896e7138a101fbb3d228946c43321503e (diff)
downloadupstream-8c33debb528919abdb11abd7561538abb57b875b.tar.gz
upstream-8c33debb528919abdb11abd7561538abb57b875b.tar.bz2
upstream-8c33debb528919abdb11abd7561538abb57b875b.zip
samba36: log error if getting device info failed
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/network/services/samba36/files')
-rw-r--r--package/network/services/samba36/files/samba.hotplug12
1 files changed, 9 insertions, 3 deletions
diff --git a/package/network/services/samba36/files/samba.hotplug b/package/network/services/samba36/files/samba.hotplug
index e1ae64e655..abb4346af0 100644
--- a/package/network/services/samba36/files/samba.hotplug
+++ b/package/network/services/samba36/files/samba.hotplug
@@ -6,7 +6,7 @@ device_get_vars() {
json_init
json_load "$(ubus call block info)"
- json_select devices
+ json_select devices || return 1
json_get_keys keys
for key in $keys
@@ -18,13 +18,16 @@ device_get_vars() {
shift
json_get_vars $@
json_select ..
- break
+ json_select ..
+ return 0
}
json_select ..
done
json_select ..
+
+ return 2
}
[ -f /var/run/config/samba ] || {
@@ -32,7 +35,10 @@ device_get_vars() {
}
[ "$ACTION" = "add" ] && {
- device_get_vars $DEVICE label mount
+ device_get_vars $DEVICE label mount || {
+ logger -t samba-hotplug "Failed to get $DEVICE info"
+ exit 1
+ }
[ -n "$mount" ] && {
uci -c /var/run/config batch <<-EOF
set samba.$DEVICE="sambashare"