#! /bin/sh -e # nps_client - script version of NightFall.city official NPS client # case "$1" in -*|'') printf '\n nps_client [:] \n\n' exit 0 ;; *) T="$(mktemp)" H="${1%:*}" [ "$H" = "$1" ] && P=1915 || P="${1#*:}" [ "${1%:*}" = "$1" ] && H="$1" P=1915 || H="${1%:*}" P="${1#*:}" if [ "$T" -a -x $(which nc) ] then ${EDITOR:-vi} $T && echo "." >> $T nc $H $P < $T && rm $T || echo "ERROR: tempfile = $T" else echo 'ERROR: nc(1) not found.' exit 1 fi ;; esac