samba36: log error if getting device info failed
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
parent
8abefc8896
commit
8c33debb52
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=samba
|
PKG_NAME:=samba
|
||||||
PKG_VERSION:=3.6.25
|
PKG_VERSION:=3.6.25
|
||||||
PKG_RELEASE:=14
|
PKG_RELEASE:=15
|
||||||
|
|
||||||
PKG_SOURCE_URL:=https://download.samba.org/pub/samba \
|
PKG_SOURCE_URL:=https://download.samba.org/pub/samba \
|
||||||
https://download.samba.org/pub/samba/stable
|
https://download.samba.org/pub/samba/stable
|
||||||
|
@ -6,7 +6,7 @@ device_get_vars() {
|
|||||||
json_init
|
json_init
|
||||||
json_load "$(ubus call block info)"
|
json_load "$(ubus call block info)"
|
||||||
|
|
||||||
json_select devices
|
json_select devices || return 1
|
||||||
|
|
||||||
json_get_keys keys
|
json_get_keys keys
|
||||||
for key in $keys
|
for key in $keys
|
||||||
@ -18,13 +18,16 @@ device_get_vars() {
|
|||||||
shift
|
shift
|
||||||
json_get_vars $@
|
json_get_vars $@
|
||||||
json_select ..
|
json_select ..
|
||||||
break
|
json_select ..
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
done
|
done
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
|
|
||||||
|
return 2
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -f /var/run/config/samba ] || {
|
[ -f /var/run/config/samba ] || {
|
||||||
@ -32,7 +35,10 @@ device_get_vars() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ "$ACTION" = "add" ] && {
|
[ "$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" ] && {
|
[ -n "$mount" ] && {
|
||||||
uci -c /var/run/config batch <<-EOF
|
uci -c /var/run/config batch <<-EOF
|
||||||
set samba.$DEVICE="sambashare"
|
set samba.$DEVICE="sambashare"
|
||||||
|
Loading…
Reference in New Issue
Block a user