From: Chris Koeritz Date: Mon, 13 Nov 2017 00:26:17 +0000 (+0000) Subject: Merge branch 'dev' of feistymeow.org:feisty_meow into dev X-Git-Tag: 2.140.98^2~3^2^2 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=202ac88dcb2ff6f16ffaeafa8d827e38a7611999;hp=df98e9588b5e6e9ca425387f9f976cb616cd7edc;p=feisty_meow.git Merge branch 'dev' of feistymeow.org:feisty_meow into dev --- diff --git a/scripts/archival/general_updater.sh b/scripts/archival/general_updater.sh index 83c97775..918671d8 100644 --- a/scripts/archival/general_updater.sh +++ b/scripts/archival/general_updater.sh @@ -11,6 +11,7 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" function update_source_folders() { folder="$1"; shift + sep if [ ! -d "$folder" ]; then echo "The folder '$folder' does not exist, so skipping repository update there." return; @@ -19,14 +20,15 @@ function update_source_folders() pushd "$folder" if [ $? -ne 0 ]; then echo Changing to the folder $folder failed. - exit 1 + return 1 fi bash "$FEISTY_MEOW_SCRIPTS/rev_control/rcheckin.sh" if [ $? -ne 0 ]; then echo Checking out the latest codes has failed somehow for $folder. - exit 1 + return 1 fi popd + sep } # this attempts to copy all the contents in a folder called "from" into a folder @@ -40,19 +42,19 @@ function synch_directory_to_target() sep if [ ! -d "$from" ]; then - echo "skipping synch on missing source directory $from; this is not normal!" - exit 1 + echo "skipping synch on missing source directory: ${from}" + return 0 fi if [ ! -d "$to" ]; then - echo "skipping synch into non-existent directory $to" - return + echo "skipping synch into non-existent target directory $to" + return 0 fi echo "synching from $from into $to" netcp "$from"/* "$to"/ if [ $? -ne 0 ]; then echo "The synchronization of $from into $to has failed." - exit 1 + return 1 fi } @@ -71,7 +73,7 @@ function update_archive_drive() ls "$target_folder" if [ $? -ne 0 ]; then echo "The target location '$target_folder' is not mounted currently, so cannot be updated." - exit 1 + return 1 fi # synch all our targets. @@ -92,6 +94,8 @@ function update_archive_drive() echo successfully updated all expected portions of the target drive at: echo " $target_folder" + echo + popd } diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 7526c8a9..fae1b6c6 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -142,7 +142,7 @@ unalias feistyme &>/dev/null ############## # set the sentinel alias that says this file was handled. -alias CORE_ALIASES_LOADED=true +#alias CORE_ALIASES_LOADED=true ############## diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl index 09885b06..a9b77747 100644 --- a/scripts/core/generate_aliases.pl +++ b/scripts/core/generate_aliases.pl @@ -152,10 +152,14 @@ Please see http://feistymeow.org for more details.\n"; #really need to use better exit codes. } +############## + $FEISTY_MEOW_LOADING_DOCK =~ s/\\/\//g; $FEISTY_MEOW_SCRIPTS =~ s/\\/\//g; $FEISTY_MEOW_APEX =~ s/\\/\//g; +############## + # create our generated shells directory if it's not already there. if (! -d $FEISTY_MEOW_LOADING_DOCK) { mkdir $FEISTY_MEOW_LOADING_DOCK; @@ -168,10 +172,14 @@ if (-d $FEISTY_MEOW_BINARIES) { system("chmod -R u+x \"$FEISTY_MEOW_BINARIES\"/*"); } +############## + # generate the first set of alias files that are defined in the core # and custom scripts directories. &rebuild_script_aliases; +############## + # trash the old versions. unlink("$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"); @@ -179,6 +187,8 @@ if (length($DEBUG_FEISTY_MEOW)) { printf "writing $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh...\n"; } +############## + # open the alias files to be created. open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"); @@ -205,7 +215,7 @@ foreach $file (@shell_files) { || $file =~ /\/\.\.$/ || $file =~ /\/\.svn$/ || $file =~ /\/\.git$/ - || $file =~ /\/customize\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_.]+$/ + || $file =~ /\/custom\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_.]+$/ #hmmm: would be nice to have this name in a symbol somewhere instead of having "customize" everywhere. ) { # just skip this item; it's a special directory or a file we don't want to include. @@ -217,4 +227,18 @@ foreach $file (@shell_files) { close(she); +############## + +# prepare a finalizer chunk that is the last thing to load. + +open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_ending_sentinel.sh"); + +# write in our sentinel alias that says alias loading was handled. +print she "define_yeti_alias CORE_ALIASES_LOADED=true\n"; + +close(she); + +############## + 1; + diff --git a/scripts/core/launch_feisty_meow.sh b/scripts/core/launch_feisty_meow.sh index a9db25b4..fc50921c 100644 --- a/scripts/core/launch_feisty_meow.sh +++ b/scripts/core/launch_feisty_meow.sh @@ -122,9 +122,8 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then fi ############## - + if [ -z "$ERROR_OCCURRED" ]; then - # pull in our generated variables that are the minimal set we need to find # the rest of our resources. source "$FEISTY_MEOW_VARIABLES_LOADING_FILE" @@ -138,10 +137,9 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then ############## if [ -z "$ERROR_OCCURRED" ]; then - - # load the larger body of standard feisty meow variables into the environment. - # we actually want this to always run also; it will decide what variables need - # to be set again. + # no error occurred in our tests above, so load the larger body of standard feisty + # meow variables into the environment. we actually want this to always run also; + # it will decide what variables need to be set again. source "$FEISTY_MEOW_SCRIPTS/core/variables.sh" ############## @@ -156,6 +154,7 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then ############## +#hmmm: abstract this to a twiddle shell options method. # check hash table before searching path. shopt -s checkhash # don't check path for sourced files. @@ -216,5 +215,8 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then unset FEISTY_MEOW_SHOW_LAUNCH_GREETING fi + # load the last bits we do here. + source "$FEISTY_MEOW_LOADING_DOCK/fmc_ending_sentinel.sh" + fi # "$NO_REPAIRS_NEEDED" was == "true" diff --git a/scripts/customize/fred/fred_common.alias b/scripts/customize/fred/fred_common.alias index 67e332a6..37b085e4 100644 --- a/scripts/customize/fred/fred_common.alias +++ b/scripts/customize/fred/fred_common.alias @@ -1,6 +1,18 @@ -# some aliases that i don't expect very many people to ever want. they are -# based on some of the mount configurations available at home or abroad. +# some aliases that i don't expect very many people to ever want. +# these are very specific to drives and such that i use but which other people wouldn't. + +# updates the mounted barkuptree drive with stuff on wildmutt. +define_yeti_alias update_barkuptree='source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"; update_archive_drive "/media/fred/barkuptreedrive"' + +# updates local archive drive called catfurnose. +define_yeti_alias update_catfurnose='source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"; update_archive_drive "/media/fred/catfurnose"' + +# updates the fredmusicprime drive with the latest from /z space. +define_yeti_alias update_fredmusicprime='source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"; update_archive_drive "/media/fred/fredmusicprime"' + +# updates my little 1 TB "soapbox" style usb drive with any appropriate archives and source. +define_yeti_alias update_soapbox='source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"; update_archive_drive "/media/fred/soapboxdrive"' # moo and unmoo mount the local folders i use most. #no longer used. we are doing mostly full directory stores without nfs mounts these days. @@ -11,3 +23,4 @@ # not currently used. this probably was adding a bit of startup time. #source "$FEISTY_MEOW_SCRIPTS/buildor/gffs_builders.sh" + diff --git a/scripts/customize/fred/scripts/archival/musical_wand.sh b/scripts/customize/fred/scripts/archival/musical_wand.sh deleted file mode 100644 index c3af4be3..00000000 --- a/scripts/customize/fred/scripts/archival/musical_wand.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -# musical_wand: distributes music from our primary source to all hosts that are listed -# as being redundant copies for the music. - -# this script is designed to be run on the music host with the super alpha main source of -# music plugged in as an external drive. that being said, it will still work as long as -# the music host has its local copy intact; the local copy of the primary is always what -# is synched onto the other archive hosts. in that sense, the musical host is itself a -# musix archive, but it is treated "special". - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" - -#hmmm: add the goodness around these actions like the "nice" updater so we catch all errors. - -# this host is where all the music is supposed to come from. -MUSICAL_HOST=curie - -#hmmm: this script is currently limited to run ON the music host. it could easily do the backwards thing instead, and copy FROM music host. - -# the list of hosts we know of that are holding onto duplicate copies of the musix archive. -#old list MUSIX_ARCHIVE_SITE_LIST=(surya banshee wildmutt euphrosyne) -MUSIX_ARCHIVE_SITE_LIST=(euphrosyne) -#hmmm: list was contracted a lot, since we don't want to step on the updates done by syncthing. euphrosyne is still our reference copy for what the archive states "should" be. - -if [[ ! ( $(hostname) =~ .*${MUSICAL_HOST}.* ) ]]; then - echo "This script is only designed to run on $MUSICAL_HOST with the" - echo "primary fred music source (external) disc plugged in." - exit 1 -fi - -# synch our local copy on the music host with the primary music drive, source of all goodness. -function get_music_from_alpha_site() -{ - sep - echo "getting musix and basement from fred music prime device" - rsync -av /media/fred/fredmusicprime/musix/* /z/musix/ - rsync -av /media/fred/fredmusicprime/basement/* /z/basement/ - sep - echo -} - -# updates the music on a remote host to our current local copy on the music host. -function update_musix_pile() -{ - sep - local host="$1"; shift - echo "$host: synching musix and basement" - rsync -avz /z/musix/* ${host}:/z/musix/ - rsync -avz /z/basement/* ${host}:/z/basement/ - sep - echo -} - -############## - -# make sure the local machine, our first-stop musix host, is in good shape. -get_music_from_alpha_site - -# run through the steps of updating all our machines. -for i in ${MUSIX_ARCHIVE_SITE_LIST[@]}; do - update_musix_pile $i -done - - diff --git a/scripts/customize/fred/scripts/archival/update_barkuptree.sh b/scripts/customize/fred/scripts/archival/update_barkuptree.sh deleted file mode 100644 index 9b0103f8..00000000 --- a/scripts/customize/fred/scripts/archival/update_barkuptree.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# updates the mounted barkuptree drive with stuff on wildmutt. -# very specific currently. - -source "$FEISTY_MEOW_SCRIPTS/core/general_updater.sh" - -update_archive_drive /media/fred/barkuptreedrive - -#gone below - -# copy up the archived bluray discs, and possibly future archived formats. -#netcp /z/archons/* $BARKY/bkup_archons/ -#test_or_die "synching archons" - -# copy over our somewhat attenuated but still important walrus archives. -#netcp /z/walrus/* $BARKY/walrus/ -#test_or_die "synching walrus" - -# copy all the music files for future reference. -#netcp /z/musix/* $BARKY/musix/ -#test_or_die "synching musix" - -# back up the photo archives. -#netcp /z/imaginations/* $BARKY/imaginations/ -#test_or_die "synching imaginations" - - diff --git a/scripts/customize/fred/scripts/archival/update_catfurnose.sh b/scripts/customize/fred/scripts/archival/update_catfurnose.sh deleted file mode 100644 index b9622bed..00000000 --- a/scripts/customize/fred/scripts/archival/update_catfurnose.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# updates local archive drive called catfurnose - -source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh" - -update_archive_drive "/media/fred/catfurnose" - diff --git a/scripts/customize/fred/scripts/archival/update_fredmusicprime.sh b/scripts/customize/fred/scripts/archival/update_fredmusicprime.sh deleted file mode 100644 index 80bb07ba..00000000 --- a/scripts/customize/fred/scripts/archival/update_fredmusicprime.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# updates my little 1 TB "soapbox" style usb drive with items that it should contain. - -source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh" - -update_archive_drive "/media/fred/fredmusicprime" - -exit $? - -#####old#####old##### -#gone below. - -sep - -echo Target drive currently has... -ls "$TARGET_FOLDER" -if [ $? -ne 0 ]; then - echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." - exit 1 -fi - -# synch all our targets. -for currdir in $MAJOR_ARCHIVE_SOURCES; do - synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ -done - -sep - -# update source code if present. -echo getting latest fred repositories... -pushd "$TARGET_FOLDER" -update_source_folders $SOURCECODE_HIERARCHY_LIST - -sep - -echo Updated all expected portions of the targets successfully. - diff --git a/scripts/customize/fred/scripts/archival/update_soapbox.sh b/scripts/customize/fred/scripts/archival/update_soapbox.sh deleted file mode 100644 index 57e1ba74..00000000 --- a/scripts/customize/fred/scripts/archival/update_soapbox.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# updates my little 1 TB "soapbox" style usb drive with items that it should contain. - -source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" -source "$FEISTY_MEOW_SCRIPTS/archival/shared_updater_parts.sh" - -# where we're backing up to. -TARGET_FOLDER="/media/fred/soapboxdrive" - -sep - -echo Target drive currently has... -ls "$TARGET_FOLDER" -if [ $? -ne 0 ]; then - echo "The target location '$TARGET_FOLDER' is not mounted currently, so cannot be updated." - exit 1 -fi - -# synch all our targets. -for currdir in $MAJOR_ARCHIVE_SOURCES; do - synch_directory_to_target "$currdir" "$TARGET_FOLDER/$(basename $currdir)"/ -done - -sep - -# update source code if present. -echo getting latest fred repositories... -pushd "$TARGET_FOLDER" -for currdir in $SOURCECODE_HIERARCHY_LIST; do - update_source_folders "$curr_dir" -done -sep - -echo Updated all expected portions of the targets successfully. - diff --git a/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh index 837cf3c7..2081b8f6 100644 --- a/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh +++ b/scripts/customize/fred/scripts/cakelampvm/revamp_web_permissions.sh @@ -25,11 +25,11 @@ group_perm /var/www ############## # set up access on some important folders for the developer user. -chown -R developer:developer /home/developer /opt/feistymeow.org /etc/apache2 /etc/bind -normal_perm /opt/feistymeow.org -# don't want others trying to check feisty meow in. -harsh_perm /opt/feistymeow.org/feisty_meow/.git +chown -R developer:developer /home/developer harsh_perm /home/developer/.ssh +chown -R developer:developer /opt/feistymeow.org +group_perm /opt/feistymeow.org +chown -R developer:developer /etc/apache2 /etc/bind group_perm /etc/apache2 /etc/bind ##############