From: Chris Koeritz Date: Mon, 22 Jun 2020 19:31:23 +0000 (+0000) Subject: Merge branch 'master' of github.com:fredhamster/feisty_meow into dev X-Git-Tag: 2.140.123^2~4^2 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=e82460bf4ea6b2beb2c9923420ac36e5a2da0709;hp=95d216b2381107474bea0a65a915936a5402df0f;p=feisty_meow.git Merge branch 'master' of github.com:fredhamster/feisty_meow into dev --- diff --git a/.gitignore b/.gitignore index 022cb9f5..a9f06ada 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ .DS_Store *.log *.gz +.no-checkin *.o *.obj *_version.rc diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index ca59f823..7a04cc83 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -104,6 +104,10 @@ endif ############################################################################### ifeq "$(COMPILER)" "GNU_DARWIN" + # finds the crypto code on macos. + HEADER_SEARCH_PATH += /usr/local/opt/openssl/include + LIBRARY_SEARCH_PATH += /usr/local/opt/openssl/lib/ + ifneq "$(USE_XWIN)" "" DEFINITIONS += __XWINDOWS__ __X__ LIBS_USED += @@ -111,7 +115,7 @@ ifeq "$(COMPILER)" "GNU_DARWIN" #need to separate out with a USE_MOTIF kind of thing. #LIBS_USED += Xmu HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include /usr/include/g++ - LIBRARY_SEARCH_PATH += /usr/X11R6/lib + LIBRARY_SEARCH_PATH += /usr/X11R6/lib endif ifneq "$(USE_SSL)" "" diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 44f6155d..0f356d6e 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -437,9 +437,11 @@ if [ -z "$skip_all" ]; then fi # launch sudo with just the variables we want to reach the other side. - # we take an extra step to null out the PATH, since MacOS seems to want - # to pass that even for a login shell (-i) somehow. - PATH= /usr/bin/sudo --preserve-env=SSH_AUTH_SOCK,IMPORTED_XAUTH "$@" + local varmods= +# varmods+="PATH= " + if [ ! -z "$IMPORTED_XAUTH" ]; then varmods+="IMPORTED_XAUTH=$IMPORTED_XAUTH "; fi + if [ ! -z "$SSH_AUTH_SOCK" ]; then varmods+="SSH_AUTH_SOCK=$SSH_AUTH_SOCK"; fi + /usr/bin/sudo $varmods "$@" retval=$? # take the xauth info away again if it wasn't set already. @@ -930,7 +932,21 @@ return 0 ############## - # site avenger aliases + # tty relevant functions... + + # keep_awake: sends a message to the screen from the background. + function keep_awake() + { + # just starts the keep_awake process in the background. + bash $FEISTY_MEOW_SCRIPTS/tty/keep_awake_process.sh & + # this should leave the job running as %1 or a higher number if there + # are pre-existing background jobs. + } + + ############## + + # site avenger functions... + function switchto() { THISDIR="$FEISTY_MEOW_SCRIPTS/site_avenger" diff --git a/scripts/customize/fred/java_profile.sh b/scripts/customize/fred/java_profile.sh index b8e71a33..f98030a6 100644 --- a/scripts/customize/fred/java_profile.sh +++ b/scripts/customize/fred/java_profile.sh @@ -22,16 +22,24 @@ function intuition_failure() ############################ -# set some fairly liberal limits for ant. -#no. export ANT_OPTS="-Xms512m -Xmx768m -XX:MaxPermSize=768m" - -############################ - # start guessing some settings... +# whatever we figure out, we want to export the java home variable. +export JAVA_HOME + # this bin portion works for most javas... export JAVA_BIN_PIECE=bin +# try using java itself to locate the JAVA_HOME if we can. +if [ ! -d "$JAVA_HOME" ]; then + JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 | grep -i java.home | sed -e 's/.*java.home = \(.*\)$/\1/') +fi + +# if that didn't work, then we try a series of random bizarro places where +# we have seen java live before. + +#hmmm: below list is way out of date. we really hope the first attempt above works. + if [ ! -d "$JAVA_HOME" ]; then # try a recent version. export JAVA_HOME=/usr/lib/jvm/java-8-oracle diff --git a/scripts/system/moodle_updater.sh b/scripts/system/moodle_updater.sh new file mode 100644 index 00000000..676b8a1e --- /dev/null +++ b/scripts/system/moodle_updater.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# updates the moodle install, assuming all paths are at the default. + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +#### +# some constants that we know are not really. +moodle_parent=/var/www/html + # parent directory is one level up from where moodle lives. +moodle_dir=moodle + # this variable is just the directory name for moodle itself, not a path. +moodle_release=moodle-3.9 + # the name of the release we're expecting to download and install +download_url="https://download.moodle.org/download.php/direct/stable39/${moodle_release}.tgz" + # where we can get the latest version of moodle for our chosen releases. +#### + +# everything below should be version invariant. + +moodle_path="$moodle_parent/$moodle_dir" + # composing the parent plus directory name should get us to moodle. + +if [ ! -d "$moodle_path" ]; then + echo "There was no moodle installation found at: $moodle_path" + exit 1 +fi + +# where we unpack our temporary stuff. +temp_install="$(mktemp -d /tmp/update_moodle.XXXXXX)" +#echo temp install dir is: $temp_install +if [ ! -d "$temp_install" ]; then + echo The temporary installation directory at: $temp_install could not be created. + exit 1 +fi + +# quit the running moodle instance. +systemctl stop httpd +exit_on_error stopping httpd process before moodle upgrade. + +# jump into our new work area. +pushd "$temp_install" + +# get the latest moodle version. this could change over time, +# but it's the best link i could find. +wget "$download_url" +exit_on_error downloading latest version of moodle. + +# use the feisty meow unpack script to extract the moodle data. +unpack "${moodle_release}.tgz" +exit_on_error unpacking latest version of moodle. + +# rename the old moodle directory to a unique name in the same area. +old_moodle_path="$moodle_parent/moodle-$(basename $temp_install)" +mv "$moodle_parent/$moodle_dir" "$old_moodle_path" +exit_on_error renaming old version of moodle. + +# move the new stuff into place. +mv "${moodle_release}/$moodle_dir" "$moodle_parent"/ +exit_on_error moving new version of moodle into place. + +# grab our important configuration files and put them back in the new directory. +cp "$old_moodle_path/config.php" "$moodle_path" +exit_on_error copying existing moodle configuration file: config.php + +echo -e "\ +==== +NOTE: This script does not copy any plugins or themes. If you are using\n\ +updated or specialized additions to moodle, please copy them from here:\n\ + $old_moodle_path\n\ +into the new install at:\n\ + $moodle_path\n\ +====\n\ +" + +# restart the running moodle instance. +systemctl stop httpd +exit_on_error starting httpd process after moodle upgrade. + +# sunshine and roses! we are through the gauntlet. + diff --git a/scripts/tty/keep_awake.sh b/scripts/tty/keep_awake.sh deleted file mode 100644 index 861425f3..00000000 --- a/scripts/tty/keep_awake.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -# keep_awake: sends a message to the screen from the background. -# -# This program is really just a way to start the keep_awake process in the -# background instead of needing to start a subshell here. There was some -# kind of snafu with the ksh environment variable $$ where it would always -# record the previous shell's number and not the current one or something.... -# -(bash $FEISTY_MEOW_SCRIPTS/tty/keep_awake_process.sh) & diff --git a/scripts/tty/keep_awake_process.sh b/scripts/tty/keep_awake_process.sh index 7c32cef7..683575b1 100644 --- a/scripts/tty/keep_awake_process.sh +++ b/scripts/tty/keep_awake_process.sh @@ -1,18 +1,18 @@ #!/bin/bash + # This program is meant to be started by the program keep_awake and has -# the basic guts that are meant to execute inside of a semi-perpetual loop. +# the guts that are meant to execute inside of a semi-perpetual loop. source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +#hmmm: is there still a process management thingy, referred to below, active in our scripts??? # save the process id for the goodbye program to deal with. #echo $$ >>$TMP/trash.last_keep_awake_process #don't let the shutdown guy know who we are; we want to keep running now. # loop sort of forever. while true; do -# this version is for keeping a modem awake. -# ping -c 7 www.gruntose.com >/dev/null - - echo "trying not to fall asleep at $(date_stringer)" - sleep 120 + echo -e "\n\ntrying not to fall asleep at $(date_stringer)\n" + # magical number of seconds to sleep... + sleep 64 done