summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-07-25 00:05:03 +1000
committerAndrew Tridgell <tridge@samba.org>2008-07-25 00:05:03 +1000
commit80abed2d4b7c23a668d987e30402dcc63c925fff (patch)
tree096587b08cfe8c283006896f2e71b97aba17aa35 /base
parent58906c424c4a45ca63a7160c738930519a494a6d (diff)
create directories if missing
Diffstat (limited to 'base')
-rwxr-xr-xbase/usr/bin/sofs7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/usr/bin/sofs b/base/usr/bin/sofs
index 57abec6..b5d6fec 100755
--- a/base/usr/bin/sofs
+++ b/base/usr/bin/sofs
@@ -277,6 +277,8 @@ sofs_conf_set() {(
file)
case "$option" in
*:*)
+ d=`dirname "$option"`
+ run_onnode all "mkdir -p \"$d\""
host=`echo "$option" | cut -d: -f2`
opt=`echo "$option" | cut -d: -f1`
tmpfile=`mktemp -p /tmp sofs.XXXXXX`
@@ -285,8 +287,11 @@ sofs_conf_set() {(
rm -f $tmpfile
;;
*)
+ d=`dirname "$option"`
+ mkdir -p "$d"
echo "$value" > "$option"
- run_onnode all rsync $HOSTNAME:"$option" "$option" 2> /dev/null
+
+ run_onnode all "mkdir -p \"$d\"; rsync $HOSTNAME:\"$option\" \"$option\" 2> /dev/null"
;;
esac
;;