#!/bin/bash # fixes the cakelampvm permissions according to the way. ############## if [[ $EUID != 0 ]]; then echo "This script must be run as root or sudo." exit 1 fi if [[ ! $(hostname) == *cakelampvm* ]]; then echo "This script is only designed to be run on the cakelampvm host." exit 1 fi ############## 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" # load dependencies for our script. source "$FEISTY_MEOW_SCRIPTS/system/common_sysadmin.sh" source "$FEISTY_MEOW_SCRIPTS/security/password_functions.sh" ############## # it's a requirement to have sql root password, since we may need some sql db configuration. load_password /etc/mysql/secret_password mysql_passwd if [ -z "$mysql_passwd" ]; then read_password "Please enter the MySQL root account password:" mysql_passwd fi if [ -z "$mysql_passwd" ]; then echo "This script must have the sql root password to proceed." exit 1 else store_password /etc/mysql/secret_password "$mysql_passwd" fi ############## sep echo "Regenerating feisty meow loading dock." 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" ############## # set up some crucial users in the mysql db that we seem to have missed previously. sep echo "Adding users to the mysql database." # 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 <