Merge remote-tracking branch 'git.kebler.net/master' into giskard

giskard
Kebler Network System Administrator 2021-04-14 11:04:36 -07:00
commit 0714ab3d81
6 changed files with 32 additions and 27 deletions

View File

@ -24,15 +24,12 @@ root_command() {
local exclude=${args[--exclude_file]} local exclude=${args[--exclude_file]}
if [[ ! $exclude ]]; then if [[ ! $exclude ]]; then
echo checking local excludes
[[ -f $source/exclude.bac ]] && exclude="$source/exclude.bac" [[ -f $source/exclude.bac ]] && exclude="$source/exclude.bac"
ls $source # ls $source
# [[ $EXCLUDE_BACKUP ]] && exclude="$BACKUP_EXCLUDE" # [[ $EXCLUDE_BACKUP ]] && exclude="$BACKUP_EXCLUDE"
fi fi
echo making exclude
exclude=$([[ $exclude ]] && echo --exclude-globbing-filelist $exclude) [[ $exclude ]] && exclude="--exclude-globbing-filelist $exclude"
echo exclude file: $exclude
# local ssh="--remote-schema \"ssh -C %s /home/sysadmin/.local/bin/rdiff-backup --server\"" # local ssh="--remote-schema \"ssh -C %s /home/sysadmin/.local/bin/rdiff-backup --server\""

View File

@ -4,7 +4,6 @@ if command -v node >/dev/null 2>&1; then
# echo addding node langauge stuff # echo addding node langauge stuff
# gives access to packages with bin in a project # gives access to packages with bin in a project
path_append ./node_modules/.bin path_append ./node_modules/.bin
export NPM_REGISTRY=https://npm.kebler.net export NPM_REGISTRY=https://npm.kebler.net
alias nr="npm run" alias nr="npm run"
alias nrs="npm -s run" alias nrs="npm -s run"
@ -45,8 +44,11 @@ alias npma="npm-add-dependencies"
# alias npmpub="npm publish --access public" # alias npmpub="npm publish --access public"
alias npmlrepub="npm publish --registry http://localhost:4873 --force --access restricted" alias npmlrepub="npm publish --registry http://localhost:4873 --force --access restricted"
alias npmlpub="npm publish --registry http://localhost:4873 --access restricted" alias npmlpub="npm publish --registry http://localhost:4873 --access restricted"
alias npmnrepub="npm publish --registry https://npm.kebler.net --force --access restricted" alias npmkrepub="npm version patch && npm publish --registry https://npm.kebler.net --access restricted"
alias npmnpub="npm publish --registry https://npm.kebler.net --access restricted" alias npmkpub="npm publish --registry https://npm.kebler.net --access restricted"
alias npmpatch="npm version patch"
alias npmmajor="npm version major"
alias npmminor="npm version minor"
alias npmjspub="npm publish --registry https://registry.npmjs.org --access public" alias npmjspub="npm publish --registry https://registry.npmjs.org --access public"
alias yalcpush="nodemon -x 'yalc push'" alias yalcpush="nodemon -x 'yalc push'"

View File

@ -27,12 +27,12 @@ export PYENV_VERSION=3.8.7
eval "$(pyenv init -)" eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)" eval "$(pyenv virtualenv-init -)"
fi
path_append "/opt/python/apps/bin" path_append "/opt/python/apps/bin"
export PIPX_HOME=/opt/python/apps export PIPX_HOME=/opt/python/apps
export PIPX_BIN_DIR=$PIPX_HOME/bin export PIPX_BIN_DIR=$PIPX_HOME/bin
fi
spipua () { spipua () {
module_load confirm module_load confirm
echo upgrading all base python packages - requires sudo access echo upgrading all base python packages - requires sudo access

View File

@ -49,11 +49,11 @@ golang_install () {
PLATFORM=$(get_platform) PLATFORM=$(get_platform)
if [ -z "$PLATFORM" ]; then if [ -z "$PLATFORM" ]; then
echo "Your operating system is not supported by this install script." echo "Your operating system is not supported by this install script."
exit 1 return 1
fi fi
module_load block module_load block
[ ! "$(module_loaded block)" ] && echo unable to load block module, exiting && exit 1 [ ! "$(module_loaded block)" ] && echo unable to load block module, exiting && return 1
module_load confirm module_load confirm
declare ENV_TYPE="u" # Which shell repo for the block declare ENV_TYPE="u" # Which shell repo for the block
@ -63,14 +63,18 @@ declare ENV_FILE # override shell repo location
# local versions of these # local versions of these
declare goroot declare goroot
declare gopath declare gopath
local force
declare OPTION declare OPTION
declare OPTARG declare OPTARG
declare OPTIND declare OPTIND
while getopts 'e:f:r:p:' OPTION; do while getopts 're:f:r:p:' OPTION; do
# echo $OPTION $OPTARG # echo $OPTION $OPTARG
case "$OPTION" in case "$OPTION" in
r)
force=true
;;
f) f)
ENV_FILE=$OPTARG ENV_FILE=$OPTARG
echo explicing setting block to $ENV_FILE echo explicing setting block to $ENV_FILE
@ -98,7 +102,7 @@ shift $(( OPTIND - 1 ))
if [[ ! $ENV_FILE ]]; then if [[ ! $ENV_FILE ]]; then
FILE=lang/go FILE=lang/go
case $ENV_TYPE in case $ENV_TYPE in
# h=host n=network b=base # h=host m=machine n=network b=base
"h") "h")
[[ -d $BASH_SHELL_HOST/$(hostname) ]] && ENV_FILE=$BASH_SHELL_HOST/$(hostname)/$FILE [[ -d $BASH_SHELL_HOST/$(hostname) ]] && ENV_FILE=$BASH_SHELL_HOST/$(hostname)/$FILE
;& ;&
@ -113,6 +117,7 @@ if [[ ! $ENV_FILE ]]; then
;; ;;
esac esac
[[ ! $ENV_FILE ]] && ENV_FILE=$HOME/.bashrc # default is userspace [[ ! $ENV_FILE ]] && ENV_FILE=$HOME/.bashrc # default is userspace
ENV_TYPE="u"
fi fi
if [[ ! $goroot ]]; then if [[ ! $goroot ]]; then
@ -143,16 +148,16 @@ echo ==== envionrment block is ====
printf "${goenv[*]}\n" printf "${goenv[*]}\n"
echo ========================================= echo =========================================
echo environment block file is $ENV_FILE echo environment block file is $ENV_FILE
confirm Do you want to continue || exit 1 confirm Do you want to continue || return 1
set_block -f $ENV_FILE -n "Go Language Environment" set_block -f $ENV_FILE -n "Go Language Environment"
if [[ $1 = remove ]]; then if [[ $1 = remove ]]; then
confirm Do you really want to remove the go installation? || exit confirm Do you really want to remove the go installation? || return 1
remove_block remove_block
confirm Delete directory $gopath??? && rm -rf $gopath confirm Delete directory $gopath??? && rm -rf $gopath
confirm Delete directory $goroot??? && rm -rf $goroot confirm Delete directory $goroot??? && rm -rf $goroot
exit return 1
fi fi
# the github api doesn't show any release records to had to grab this way # the github api doesn't show any release records to had to grab this way
@ -162,14 +167,17 @@ if [[ $(which go) ]]; then
# INSTALLED_VERSION=1.15.2 # this is for testing, comment out for production # INSTALLED_VERSION=1.15.2 # this is for testing, comment out for production
echo installed: $INSTALLED_VERSION available: $VERSION echo installed: $INSTALLED_VERSION available: $VERSION
if [ "$INSTALLED_VERSION" == "$VERSION" ]; then if [ "$INSTALLED_VERSION" == "$VERSION" ]; then
if [[ ! $force ]]; then
echo Installed Version $INSTALLED_VERSION is current nothing to do, exiting echo Installed Version $INSTALLED_VERSION is current nothing to do, exiting
exit 0 echo use -r flag to force reinstall
return 2
fi
fi fi
fi fi
if [ -d "$goroot" ]; then if [ -d "$goroot" ]; then
echo "The Go install directory ($goroot) already exists. " echo "The Go install directory ($goroot) already exists. "
confirm Do you want to upgrade to $VERSION? || exit confirm Do you want to upgrade to $VERSION? || return 0
fi fi
echo installing version $VERSION ...... echo installing version $VERSION ......
@ -186,14 +194,14 @@ fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Download failed! Exiting." echo "Download failed! Exiting."
exit 1 return 1
fi fi
echo "Extracting File..." echo "Extracting File..."
mkdir -p "$goroot" mkdir -p "$goroot"
# TODO set correct permissions here if necessary # TODO set correct permissions here if necessary
tar -C "$goroot" --strip-components=1 -xzf "$TEMP_DIRECTORY/go.tar.gz" sudo tar -C "$goroot" --strip-components=1 -xzf "$TEMP_DIRECTORY/go.tar.gz"
echo done installing go binary and support files echo done installing go binary and support files
@ -214,5 +222,6 @@ block_add_line "${goenv[*]}"
# echo ------------------------------------------------ # echo ------------------------------------------------
echo -e "\nGo $VERSION was installed into $goroot.\n(re)start a new shell environment to take effect" echo -e "\nGo $VERSION was installed into $goroot.\n(re)start a new shell environment to take effect"
echo NOTE: all files have root:root user:group, run a chown/chmod/setfacl commands if need be
return 0
} }

View File

@ -12,6 +12,5 @@ echo no folders to delete
fi fi
} }
# if script was executed then call the function # if script was executed then call the function
(return 0 2>/dev/null) || rm_node_modules $@ (return 0 2>/dev/null) || rm_node_modules $@

View File

@ -1,2 +0,0 @@
echo setting up bindmounts for chromium
echo sudo -s "/bin/bash /opt/bin/bmount -u $USER -g users /mnt/common/home /mnt/AllData/tempbind"