Minor fixes.

This commit is contained in:
bʰedoh₂ swé 2024-12-16 22:46:50 +05:00
parent bfc53b8515
commit 178663507b

View File

@ -2,17 +2,15 @@
set -e
ip="${1}"
port="${2}"
[ -z "${ip}" ] && print_usage 'No IP given.'
[ -z "${port}" ] && print_usage 'No port given.'
[ -z "${3}" ] || print_usage 'Too many arguments.'
get_termsize() {
echo "`expr $(stty -a < $(tty) | grep -Po '(?<=rows )\d+') - 1`"
}
print_usage() {
echo "${1}"
echo "${0} <IP> <PORT>"
exit
}
[ -z "${ip}" ] && print_usage 'No IP given.'
[ -z "${port}" ] && print_usage 'No port given.'
[ -z "${3}" ] || print_usage 'Too many arguments.'
send_message() {
exec 3<> "/dev/tcp/${ip}/${port}"