X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsite_avenger%2Frevamp_cakelampvm_v002.sh;h=1565060572d186be846092d7e0e134d2eacf665d;hb=45c6332c5f652d7287ac52ede6a342cd4ee64573;hp=b71d8835fc59d35daa3de0b53a646573cd673ffe;hpb=95c741fe5a5f9da6ce7fc54f67ef29c976d518cc;p=feisty_meow.git diff --git a/scripts/site_avenger/revamp_cakelampvm_v002.sh b/scripts/site_avenger/revamp_cakelampvm_v002.sh index b71d8835..15650605 100644 --- a/scripts/site_avenger/revamp_cakelampvm_v002.sh +++ b/scripts/site_avenger/revamp_cakelampvm_v002.sh @@ -16,8 +16,8 @@ fi ############## -export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. -export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )" +export THISDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. +export FEISTY_MEOW_APEX="$( \cd "$THISDIR/../.." && \pwd )" export NO_HELLO=right source "$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh" @@ -46,9 +46,9 @@ 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" +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" ############## @@ -69,7 +69,7 @@ mysql -u root -p"$mysql_passwd" &>/dev/null < "/tmp/install_bluefish-$(logname).log" -#test_or_continue "installing bluefish editor" - -############## - # deploy any site updates here to the VM's cakelampvm.com site. # # we want to upgrade the default apache site to the latest, since the new @@ -164,26 +159,26 @@ if [ -L /etc/apache2/sites-enabled/000-default.conf ]; then echo "Updating default web sites to latest version." a2enmod ssl - test_or_die "enabling SSL for secure websites" + exit_on_error "enabling SSL for secure websites" restart_apache - test_or_die "getting SSL loaded in apache" + exit_on_error "getting SSL loaded in apache" a2dissite 000-default - test_or_die "disabling old apache site" + exit_on_error "disabling old apache site" rm -f /etc/apache2/sites-available/000-default.conf - test_or_die "removing old apache site" + exit_on_error "removing old apache site" # copy in our new version of the default page. #hmmm: would be nice if this worked without mods for any new version, besides just 001. see apache env var file below for example implem. \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/default_page.001/* \ /etc/apache2/sites-available - test_or_die "installing new apache default sites" + exit_on_error "installing new apache default sites" # there should only be ours at this version level and with that prefix. a2ensite 001-* - test_or_die "enabling new apache default sites" + exit_on_error "enabling new apache default sites" restart_apache fi @@ -252,7 +247,7 @@ replacement="read only = no" # after realizing the sentinel pattern was actually already in the file... # too much subtlety can get one into trouble. 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" +exit_on_error "patching samba configuration to enable write acccess on user home dirs" echo successfully patched the samba configuration to enable writes on user home directories. # add in a disabling of the archive bit mapping feature, which hoses up the execute bit @@ -261,7 +256,7 @@ 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 "s/\[global\]/\[global\]\n\nmap archive = no/" /etc/samba/smb.conf - test_or_die "patching samba configuration to turn off archive bit mapping feature" + exit_on_error "patching samba configuration to turn off archive bit mapping feature" echo Successfully fixed Samba to not use the archive bit mapping feature. fi @@ -280,11 +275,11 @@ a2disconf env_vars_cakelampvm &>/dev/null # plug in the new version, just stomping anything there. # note: we only expect to have one version of the env_vars dir at a time in place in feisty... \cp -f $FEISTY_MEOW_APEX/production/sites/cakelampvm.com/rolling/env_vars.*/env_vars_cakelampvm.conf /etc/apache2/conf-available -test_or_die "copying environment variables file into place" +exit_on_error "copying environment variables file into place" # enable the new version of the config file. a2enconf env_vars_cakelampvm -test_or_die "enabling the new cakelampvm environment config for apache" +exit_on_error "enabling the new cakelampvm environment config for apache" echo Successfully configured the apache2 environment variables needed for cakelampvm. @@ -349,7 +344,7 @@ sep echo Adding site avenger packages to composer. # add in site avenger dependencies so we can build avcore properly. pushd ~ &>/dev/null -sudo -u $(logname) composer config -g repositories.siteavenger composer https://packages.siteavenger.com/ +sudo -u $(fm_username) composer config -g repositories.siteavenger composer https://packages.siteavenger.com/ popd &>/dev/null ############## @@ -382,9 +377,9 @@ fi 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" +exit_on_error "regenerating feisty meow scripts" +chown -R "$(fm_username)":"$(fm_username)" /home/$(fm_username)/.[a-zA-Z0-9]* +exit_on_error "fix after regenerate as sudo" echo "