# boards - telnet BBS dialing book
#
# Picks a board from a numbered list and dials it via vt(1) so
# ANSI art and full-screen menus render correctly.  Add your own
# entries by editing this file or pasting from a Synchronet /
# fsxNet directory.
#
# usage:
#   boards          show the menu, prompt for a number
#   boards N        dial entry N directly

# `test -z $1` is brittle in zrc when the arg is unset (the variable
# expands to nothing, leaving `test` with one operand instead of two).
# Use the count form `$#1` and avoid `if not`, both of which trip
# zrc parser bugs.  See project_zrc_parser_bugs.
pick=''
if (~ $#1 0) {
    echo 'Telnet BBS dialing book:'
    echo '  1. Telehack            telehack.com'
    echo '  2. Level 29            bbs.fozztexx.com'
    echo '  3. Pharcyde            bbs.pharcyde.org'
    echo '  4. Star Wars (towel)   towel.blinkenlights.nl'
    echo '  5. Dura-Bright         durabright.zapto.org'
    echo ''
    echo 'Pick a number (or Enter to cancel):'
    read pick
}
if (~ $#1 1) {
    pick=$1
}

if (~ $pick 1) { telnet telehack.com 23 ; exit 0 }
if (~ $pick 2) { telnet bbs.fozztexx.com 23 ; exit 0 }
if (~ $pick 3) { telnet bbs.pharcyde.org 23 ; exit 0 }
if (~ $pick 4) { telnet towel.blinkenlights.nl 23 ; exit 0 }
if (~ $pick 5) { telnet durabright.zapto.org 23 ; exit 0 }

if (~ $pick '') { exit 0 }
echo 'No such entry.'
exit 1
