34 lines
1.1 KiB
Bash
Executable file
34 lines
1.1 KiB
Bash
Executable file
#!/bin/sh -e
|
|
|
|
# make username uppercase
|
|
username=$(echo "$USER" | tr '[:lower:]' '[:upper:]')
|
|
timezone=UTC
|
|
chatlog=/var/log/bunkchat/chat.log
|
|
prompt=""
|
|
|
|
makeSlug () {
|
|
# make time and date
|
|
time=$(TZ=${timezone} date +%I:%M%p)
|
|
date=$(TZ=${timezone} date +%m/%d)
|
|
|
|
# make name/time string
|
|
prompt="${username}-${date}-${time}"
|
|
}
|
|
|
|
# enter bunkchat mode (clear the screen)
|
|
clear
|
|
|
|
while true
|
|
do
|
|
echo "┏━┓┏━┓┏━┓┏━╸╻ ┏━┓╻┏┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸"
|
|
echo "┣━┛┣┳┛┃ ┃┃ ┃ ┣━┫┃┃┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ "
|
|
echo "╹ ╹┗╸┗━┛┗━╸┗━╸╹ ╹╹╹ ╹ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ "
|
|
echo "You may view current chat with 'heed'!"
|
|
echo "You may view old chat with 'scry'!"
|
|
echo "----------------------------------"
|
|
printf "speak to the server: "
|
|
read -r text
|
|
makeSlug
|
|
echo "${prompt}: $text" >> $chatlog
|
|
clear
|
|
done
|