aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/samba36/files/samba.hotplug
diff options
context:
space:
mode:
authorRosy Song <rosysong@rosinson.com>2018-05-02 10:48:36 +0800
committerJohn Crispin <john@phrozen.org>2018-05-02 09:18:27 +0200
commitfd569e5e9d0a46ea957cb253e97a4b3ea8c2c540 (patch)
tree9c2a6ec223a2318b4f829143d31875deaef7d82e /package/network/services/samba36/files/samba.hotplug
parent2c4294f78612d038a2b130171fe25ed8e6569bae (diff)
downloadupstream-fd569e5e9d0a46ea957cb253e97a4b3ea8c2c540.tar.gz
upstream-fd569e5e9d0a46ea957cb253e97a4b3ea8c2c540.tar.bz2
upstream-fd569e5e9d0a46ea957cb253e97a4b3ea8c2c540.zip
samba36: add hotplug support
Add hotplug handle script for storage devices, this will add corresponding option in the /etc/config/samba file automatically. Signed-off-by: Rosy Song <rosysong@rosinson.com>
Diffstat (limited to 'package/network/services/samba36/files/samba.hotplug')
-rw-r--r--package/network/services/samba36/files/samba.hotplug11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/network/services/samba36/files/samba.hotplug b/package/network/services/samba36/files/samba.hotplug
new file mode 100644
index 0000000000..9c6dbe5e41
--- /dev/null
+++ b/package/network/services/samba36/files/samba.hotplug
@@ -0,0 +1,11 @@
+. /lib/samba/samba.sh
+
+samba_dev_filter $DEVNAME
+[ "$FLAG_DEV_TYPE" = "not-mtd" ] || exit
+
+config_load samba
+case $ACTION in
+ add) samba_add_section $DEVNAME;;
+ remove) samba_delete_section $DEVNAME;;
+esac
+uci commit samba