From: Chris Koeritz Date: Sun, 17 Dec 2017 13:49:36 +0000 (-0500) Subject: samba fix for user homes should work now. X-Git-Tag: 2.140.106^2~23 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=190b8abf3f0c3ad799d8eedc30c52fb5b6e8ad39 samba fix for user homes should work now. --- diff --git a/scripts/site_avenger/revamp_cakelampvm.sh b/scripts/site_avenger/revamp_cakelampvm.sh index 9afd9214..a9016d8c 100644 --- 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? -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 - echo "the samba configuration has already been fixed for user homes, so that's fine." + echo "the samba configuration has already been fixed for user homes, s'cool." 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 - 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 ##############