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:
commit
95901b3805
25
autoattach
25
autoattach
|
@ -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 ;;
|
||||
|
|
Loading…
Reference in New Issue