refactored startup script, removed as function so it can be sourced immediately, needed this so that startup scripts sourced can export to main login environment.
changed startup in setup in /etc/profile.d accordingly so it sources intead of calls async for the same reason add notify module with login_notify to delay notification until user is logged in added lag to alias, and made load debug module is load in file module.master
parent
d6dfa7753a
commit
de43f28f78
|
@ -37,6 +37,7 @@ alias grep='grep --color'
|
|||
alias ls='ls -F --color=auto'
|
||||
alias l='ls'
|
||||
alias la='ls -a'
|
||||
alias lag='ls -a | grep'
|
||||
alias ll='ls -l'
|
||||
alias lla='ls -l -a'
|
||||
alias llag='ls -l -a | grep'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export BASH_DEBUG=true
|
||||
module_load debug
|
||||
|
||||
build_file () {
|
||||
[[ -f "$2" ]] || (echo "output file $2 does not exist";return 1)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
function dtnotify () {
|
||||
(notify-send "$1") &
|
||||
}
|
||||
|
||||
function login_notify () {
|
||||
(sleep 10;notify-send "$1") &
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ export PATH=/bin:/usr/bin:/usr/local/bin
|
|||
# set directory for base shell repo
|
||||
export BASH_SHELL_BASE=THISWILLCHANGEDBYDEPLOYSCRIPT
|
||||
# now bootstrap by souring the shell repo envinroment
|
||||
. $BASH_SHELL_BASE/shell.env
|
||||
source $BASH_SHELL_BASE/shell.env
|
||||
# uncomment to NOT load the BASH SHELL Repos for interactive login shell
|
||||
# NO_LOGIN_BASHRC=true
|
||||
if [[ $- == *i* ]]; then # interactive?
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
if [ "$SHELL" = "/bin/bash" ] && [ "${BASH_SHELL_STARTUP}" ] && [ "$(ps -o comm= $PPID)" != "su" ]; then
|
||||
# uncomment for debugging
|
||||
if [[ -f $BASH_SHELL_STARTUP ]] && [[ $EUID -ne 0 ]]; then
|
||||
llog "running startup script $BASH_SHELL_STARTUP async"
|
||||
(${BASH_SHELL_STARTUP}) &
|
||||
llog "sourcing startup script $BASH_SHELL_STARTUP"
|
||||
# (${BASH_SHELL_STARTUP}) &
|
||||
source ${BASH_SHELL_STARTUP}
|
||||
fi
|
||||
fi
|
||||
|
|
14
startup.sh
14
startup.sh
|
@ -1,18 +1,10 @@
|
|||
#!/bin/bash
|
||||
function startup_load () {
|
||||
local SDIRS
|
||||
local SDIR
|
||||
local DIRS
|
||||
local DIR
|
||||
local excludes
|
||||
|
||||
|
||||
[[ $(declare -F | grep module_load) ]] && echo module lib already loaded || source "$BASH_SHELL_BASE/module.lib"
|
||||
module_load file
|
||||
[[ $? -ne 0 ]] && echo unable to access the file module, aboarting load && return 1
|
||||
|
||||
|
||||
[[ $1 ]] && DIRS=($1) || DIRS=(${BASH_SHELL_DIRS})
|
||||
DIRS=(${BASH_SHELL_DIRS})
|
||||
# llog "startup directories to try ${DIRS[*]}"
|
||||
SDIRS=()
|
||||
j=0
|
||||
|
@ -34,7 +26,3 @@ IGNORE_FILE="$([[ -f "$DIR/.bash-shell-ignore" ]] && echo "$DIR" || echo "$BASH_
|
|||
llog "startup dir to source $SDIR"
|
||||
source_dir -f "$IGNORE_FILE" -d 0 $SDIR
|
||||
done
|
||||
}
|
||||
|
||||
# if script was executed then call the function
|
||||
(return 0 2>/dev/null) || startup_load
|
||||
|
|
Loading…
Reference in New Issue