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