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"
##############
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"
##############
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"
##############
# set up access on some important folders for the developer user.
chown -R developer:developer /home/developer /home/developer/.[a-zA-Z0-9]*
-test_or_die "chown developer home"
+exit_on_error "chown developer home"
harsh_perm /home/developer/.ssh
-test_or_die "harsh_perm setting on developer .ssh"
+exit_on_error "harsh_perm setting on developer .ssh"
+
+
+##############
+
+# 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"
##############
# fix perms for fred user.
chown -R fred:fred /home/fred /home/archives/stuffing /home/fred/.[a-zA-Z0-9]*
-test_or_die "chown fred home"
+exit_on_error "chown fred home"
group_perm $HOME/apps
-test_or_die "group perms on fred's apps"
+exit_on_error "group perms on fred's apps"
harsh_perm /home/fred/.ssh
-test_or_die "harsh_perm setting on fred .ssh"
+exit_on_error "harsh_perm setting on fred .ssh"
group_perm /home/fred/apps/mapsdemo
-test_or_die "group perms on mapsdemo app"
+exit_on_error "group perms on mapsdemo app"
-echo "Done with important permission changes."
+echo "...done with permission changes."
##############
#
if [ -f "$HOME/hello.txt" ]; then
# copy the most recent hello file into place for the user.
\cp -f "$FEISTY_MEOW_APEX/production/sites/cakelampvm.com/hello.txt" "$HOME"
- test_or_continue "copying hello file for user"
+ continue_on_error "copying hello file for user"
fi
##############
-# install a better editor app.
-
-#sep
-
-#echo "The script is about to install the bluefish editor and some dependencies.
-#If the app is not already installed, then this process takes about one minute
-#on a slow home DSL internet connection..."
-
-#apt-get install -y bluefish &> "/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
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
# 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
# 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
# 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.
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
##############
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 "