unified logname uses into fm_username
[feisty_meow.git] / scripts / site_avenger / revamp_cakelampvm_v003.sh
index 66e4c89b2d347b5827df5f675fd6f003f6c452c4..5a230615f31583d233c8a7573cf5b43d0edc0fbb 100644 (file)
@@ -45,10 +45,10 @@ sep
 
 echo "Regenerating feisty meow loading dock."
 
-regenerate
-test_or_die "regenerating feisty meow configuration"
-chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after reconfigured as sudo"
+recustomize
+exit_on_error "regenerating feisty meow configuration"
+chown -R "$(fm_username)":"$(fm_username)" /home/$(fm_username)/.[a-zA-Z0-9]*
+exit_on_error "fix after reconfigured as sudo"
 
 ##############
 
@@ -58,7 +58,12 @@ sep
 
 echo "Adding users to the mysql database."
 
-#hmmm: good application for hiding output unless error here.
+# note regarding v003 of the revamp script: i am leaving the mysql code
+# alone for the moment; it's a good example of using our password, gathered
+# above.  (a better example wouldn't pass the password on the command line
+# but involving an "expect" script is out of scope currently.)  --fred
+
+#hmmm: good example here for why we need the code that "hides output unless error".
 mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
   create user if not exists 'root'@'%' IDENTIFIED BY '$mysql_passwd';
   grant all privileges on *.* TO 'root'@'%' with grant option;
@@ -69,7 +74,7 @@ mysql -u root -p"$mysql_passwd" &>/dev/null <<EOF
   create user if not exists 'lampcake'@'%' IDENTIFIED BY 'bakecamp';
   grant all privileges on *.* TO 'lampcake'@'%' with grant option;
 EOF
-test_or_die "configuring root, wampcake and lampcake users on mysql"
+exit_on_error "configuring root, wampcake and lampcake users on mysql"
 
 ##############
 
@@ -81,9 +86,9 @@ echo "Making some important permission changes..."
 
 # fix up the main web storage.
 chown -R www-data:www-data /var/www 
-test_or_die "chown www-data"
+exit_on_error "chown www-data"
 group_perm /var/www 
-test_or_die "group_perm www-data"
+exit_on_error "group_perm www-data"
 
 ##############
 
@@ -92,20 +97,20 @@ test_or_die "group_perm www-data"
 # set the developer user as uber owner of many things with redeveloper alias.
 # (must have run feisty meow "recustomize" command at some point to enable.)
 redeveloper
-test_or_die "running redeveloper to fix ownership"
+exit_on_error "running redeveloper to fix ownership"
 
 ##############
 
 # give the developer control over the apache and bind config files, as well
 # as giving the user ownership of the local feisty meow repository.
 chown -R developer:developer /etc/apache2 /etc/bind 
-test_or_die "chown apache2 and bind to developer"
+exit_on_error "chown apache2 and bind to developer"
 group_perm /etc/apache2 /etc/bind 
-test_or_die "group perms on apache2 and bind"
+exit_on_error "group perms on apache2 and bind"
 chown -R developer:developer /opt/feistymeow.org 
-test_or_die "chown feisty meow to developer"
+exit_on_error "chown feisty meow to developer"
 group_perm /opt/feistymeow.org 
-test_or_die "group perms on feisty meow"
+exit_on_error "group perms on feisty meow"
 
 ##############
 
@@ -132,17 +137,17 @@ echo "...done with permission changes."
 
 sep
 
-regenerate
-test_or_die "regenerating feisty meow scripts"
-chown -R "$(logname)":"$(logname)" /home/$(logname)/.[a-zA-Z0-9]*
-test_or_die "fix after regenerate as sudo"
+recustomize
+exit_on_error "recustomize-ing feisty meow scripts"
+chown -R "$(fm_username)":"$(fm_username)" /home/$(fm_username)/.[a-zA-Z0-9]*
+exit_on_error "fix after recustomize as sudo"
 echo "
 
 
 Thanks for revamping your cakelampvm.  :-)
 
 You may want to update your current shell's feisty meow environment by typing:
-  regenerate
+  recustomize
 "
 
 ##############