Merge branch '2-suppress-autoattach-output' into 'master'

Resolve "Suppress autoattach output"

Closes #2

See merge request lhprojects-information-network/scripts!2
This commit is contained in:
Lutchy Horace 2021-01-26 21:30:10 -05:00
commit 95901b3805
1 changed files with 19 additions and 6 deletions

View File

@ -14,12 +14,26 @@ function write_setting
fi
}
function is_tmux_running
{
if [ -n "${TMUX}" ]; then
return 0
fi
return 1
}
function debug
{
if ! is_tmux_running; then
echo $1
fi
}
function attach_session
{
if [ -n "${TMUX}" ]; then
exit 1
fi
if is_tmux_running; then
exit 0
fi
tmux attach -t $1 2> /dev/null
@ -61,7 +75,6 @@ function usage
exit 0
}
# Load configuration file
test -f $CONF_FILE && . $CONF_FILE
@ -70,8 +83,8 @@ PLATFORM='unknown'
unamestr=$(uname)
case "$unamestr" in
OpenBSD* )
echo "*BSD OS detected!!"
echo "Long options is disabled!!"
debug "*BSD OS detected!!"
debug "Long options is disabled!!"
OPTS=`getopt chgs: $*`
set_opts_exit_status=$?
PLATFORM=$unamestr ;;