diff mbox

[OpenWrt-Devel,RFC,08/10] samba36: generate config in /tmp/etc

Message ID 1459187509-12124-9-git-send-email-stijn@linux-ipv6.be
State RFC
Headers show

Commit Message

Stijn Tintel March 28, 2016, 5:51 p.m. UTC
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
 package/network/services/samba36/files/samba.init | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init
index 376ae89..f88e0f3 100755
--- a/package/network/services/samba36/files/samba.init
+++ b/package/network/services/samba36/files/samba.init
@@ -33,18 +33,18 @@  smb_header() {
 	config_get description $1 description "Samba on ${hostname:-OpenWrt}"
 	config_get charset     $1 charset     "UTF-8"
 
-	mkdir -p /var/etc
+	mkdir -p /tmp/etc
 	sed -e "s#|NAME|#$name#g" \
 	    -e "s#|WORKGROUP|#$workgroup#g" \
 	    -e "s#|DESCRIPTION|#$description#g" \
 	    -e "s#|INTERFACES|#$interfaces#g" \
 	    -e "s#|CHARSET|#$charset#g" \
-	    /etc/samba/smb.conf.template > /var/etc/smb.conf
+	    /etc/samba/smb.conf.template > /tmp/etc/smb.conf
 
 	local homes
 	config_get_bool homes $1 homes 0
 	[ $homes -gt 0 ] && {
-		cat <<EOT >> /var/etc/smb.conf
+		cat <<EOT >> /tmp/etc/smb.conf
 
 [homes]
 	comment     = Home Directories
@@ -54,7 +54,7 @@  smb_header() {
 EOT
 	}
 
-	[ -L /etc/samba/smb.conf ] || ln -nsf /var/etc/smb.conf /etc/samba/smb.conf
+	[ -L /etc/samba/smb.conf ] || ln -nsf /tmp/etc/smb.conf /etc/samba/smb.conf
 }
 
 smb_add_share() {
@@ -78,13 +78,13 @@  smb_add_share() {
 
 	[ -z "$name" -o -z "$path" ] && return
 
-	echo -e "\n[$name]\n\tpath = $path" >> /var/etc/smb.conf
-	[ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/smb.conf
-	[ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /var/etc/smb.conf
-	[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/smb.conf
-	[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/smb.conf
-	[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/smb.conf
-	[ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" >> /var/etc/smb.conf
+	echo -e "\n[$name]\n\tpath = $path" >> /tmp/etc/smb.conf
+	[ -n "$users" ] && echo -e "\tvalid users = $users" >> /tmp/etc/smb.conf
+	[ -n "$read_only" ] && echo -e "\tread only = $read_only" >> /tmp/etc/smb.conf
+	[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /tmp/etc/smb.conf
+	[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /tmp/etc/smb.conf
+	[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /tmp/etc/smb.conf
+	[ -n "$browseable" ] && echo -e "\tbrowseable = $browseable" >> /tmp/etc/smb.conf
 }
 
 init_config() {