Support for different flavors of BSD systems.

This commit is contained in:
Lutchy Horace 2021-01-26 04:21:38 -05:00
parent d9e8654e30
commit 3d3e3ddd5f
1 changed files with 16 additions and 14 deletions

View File

@ -27,8 +27,8 @@ function attach_session
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "There is no tmux session '$1'" echo "There is no tmux session '$1'"
if [ -z "${AUTO_CREATE}" ]; then if [ -z "${AUTO_CREATE}" ]; then
read -p "Do you want me to auto create sessions by default? (y/n): " read -p "Do you want me to auto create sessions by default? [Y/n]: "
if [ "${REPLY}" = "y" ]; then if [ "${REPLY}" = "y" -o -z "${REPLY}" ]; then
write_setting 'AUTO_CREATE' '1' write_setting 'AUTO_CREATE' '1'
AUTO_CREATE=1 AUTO_CREATE=1
else else
@ -66,13 +66,15 @@ function usage
test -f $CONF_FILE && . $CONF_FILE test -f $CONF_FILE && . $CONF_FILE
# Detect platform # Detect platform
case "$OSTYPE" in PLATFORM='unknown'
freebsd* ) unamestr=$(uname)
echo "Freebsb detected!!" case "$unamestr" in
OpenBSD* )
echo "*BSD OS detected!!"
echo "Long options is disabled!!" echo "Long options is disabled!!"
OPTS=`getopt chgs: $*` OPTS=`getopt chgs: $*`
set_opts_exit_status=$? set_opts_exit_status=$?
PLATFORM='Freebsd' ;; PLATFORM=$unamestr ;;
#if [ $? -ne 0 ]; then #if [ $? -ne 0 ]; then
# echo 'Usage: ...' # echo 'Usage: ...'
# exit 2 # exit 2