Add a default configuration for rowbot

This commit is contained in:
Nick Chambers 2021-06-14 17:41:05 -05:00
parent eb15437c9a
commit 3fca870f32
1 changed files with 15 additions and 2 deletions

17
rowbot
View File

@ -14,7 +14,7 @@ while (( $# )); do
;; ;;
--no-*) --no-*)
key=${1#--no-} key=${1#--no-}
opts[$key]=false opts[$key]=no
;; ;;
--) --)
shift shift
@ -22,7 +22,7 @@ while (( $# )); do
;; ;;
--*) --*)
key=${1#--} key=${1#--}
opts[$key]=true opts[$key]=yes
;; ;;
*) *)
break break
@ -30,3 +30,16 @@ while (( $# )); do
shift shift
done done
###
# default config
##
server=${opts[server]:-irc.libera.chat}
tls=${opts[tls]:-no}
if [[ tls = no ]]; then
port=${opts[port]:-6667}
else
port=${opts[port]:-6697}
fi