first commit
This commit is contained in:
36
gaboshlib.include
Normal file
36
gaboshlib.include
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /etc/profile
|
||||
|
||||
# export all functions
|
||||
set -a
|
||||
|
||||
|
||||
## Include functions
|
||||
. /etc/bash/gaboshlib/g_*.bashfunc
|
||||
##
|
||||
|
||||
# if runnign directly from shell
|
||||
if echo $0 | egrep -q '^-bash$|^-su$'
|
||||
then
|
||||
g_scriptname=bash
|
||||
else
|
||||
g_scriptname=$(basename $0)
|
||||
fi
|
||||
|
||||
# TMPDIR
|
||||
[ -w /tmp ] && g_tmp=/tmp
|
||||
df -h /tmp | grep -q tmpfs && g_tmp=~/.g_tmp
|
||||
[ -w /data-crypt/share/tmp ] && g_tmp=/data-crypt/share/tmp
|
||||
g_tmp="$g_tmp/g_$g_scriptname-$$"
|
||||
[ -d "$g_tmp" ] || mkdir -p "$g_tmp"
|
||||
|
||||
# START and EXIT Notification
|
||||
g_trap_exit="g_logger EXITING $g_scriptname ; rm -r $g_tmp"
|
||||
trap "$g_trap_exit" EXIT
|
||||
g_syslogtag="g_bash-script:$g_scriptname[$$]"
|
||||
[ $g_scriptname = "bash" ] || g_logger STARTING $g_scriptname
|
||||
|
||||
# PATH
|
||||
[ -d /etc/thinclient/scripts ] && PATH=$PATH:/etc/thinclient/scripts
|
||||
|
||||
Reference in New Issue
Block a user