new fortune
[feisty_meow.git] / scripts / site_avenger / revamp_cakelampvm.sh
index 96daae907e2dd4b753ed65f4bdca2d25ad735aa3..b71d8835fc59d35daa3de0b53a646573cd673ffe 100644 (file)
@@ -9,6 +9,11 @@ if [[ $EUID != 0 ]]; then
   exit 1
 fi
 
+if [[ ! $(hostname) == *cakelampvm* ]]; then
+  echo "This script is only designed to be run on the cakelampvm host."
+  exit 1
+fi
+
 ##############
 
 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
@@ -255,7 +260,9 @@ echo successfully patched the samba configuration to enable writes on user home
 grep -q "map archive" /etc/samba/smb.conf
 # if the phrase wasn't found, we need to add it.
 if [ $? -ne 0 ]; then
-  sed -i "/\[global\]/[global]\n\nmap archive = no" /etc/samba/smb.conf
+  sed -i "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf
+  test_or_die "patching samba configuration to turn off archive bit mapping feature"
+  echo Successfully fixed Samba to not use the archive bit mapping feature.
 fi
 
 # sweet, looks like that worked...