projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5014baf
)
samba fix for user homes should work now.
author
Chris Koeritz
<fred@gruntose.com>
Sun, 17 Dec 2017 13:49:36 +0000
(08:49 -0500)
committer
Chris Koeritz
<fred@gruntose.com>
Sun, 17 Dec 2017 13:49:36 +0000
(08:49 -0500)
scripts/site_avenger/revamp_cakelampvm.sh
patch
|
blob
|
history
diff --git
a/scripts/site_avenger/revamp_cakelampvm.sh
b/scripts/site_avenger/revamp_cakelampvm.sh
index 9afd92140f3d0aa2f717a58b31ec31dde6ca4f72..a9016d8c5af158567714c54f17415e79ffac5100 100644
(file)
--- a/
scripts/site_avenger/revamp_cakelampvm.sh
+++ b/
scripts/site_avenger/revamp_cakelampvm.sh
@@
-176,13
+176,22
@@
fi
# fix samba configuration for (ass-headed) default of read-only in user homes.
# why add a necessary feature if you're just going to cripple it by default?
# fix samba configuration for (ass-headed) default of read-only in user homes.
# why add a necessary feature if you're just going to cripple it by default?
-search_replace a b
-/etc/samba/smb.confÂ
+pattern="[#;][[:blank:]]*read only = yes"
+replacement="read only = no"
+
+# first see if we've already done this.
+# if we find any occurrence of the replacement, we assume we already did it.
+# ** we're assuming a lot about the structure of the samba config file!
+grep -q "$replacement" /etc/samba/smb.confÂ
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
- echo "the samba configuration has already been fixed for user homes, s
o that's fine
."
+ echo "the samba configuration has already been fixed for user homes, s
'cool
."
else
else
+ # so not there yet; we need to make the replacement.
+ sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
+ test_or_die "patching samba configuration to enable write acccess on user home dirs"
+ # sweet, looks like that worked...
restart_samba
restart_samba
- echo successfully patched the samba configuration to enable writes on user home directories.
super
cool.
+ echo successfully patched the samba configuration to enable writes on user home directories.
way
cool.
fi
##############
fi
##############