Added UUCP stuff

This commit is contained in:
Praetor 2019-02-16 12:48:57 -06:00
parent 7f52b15d63
commit 1ffd7292e6
1 changed files with 9 additions and 2 deletions

11
gab
View File

@ -8,9 +8,10 @@
help_text=$'GAB - A simple chat interface\n\nsyntax: gab [flag] [value]\n\nflag value\n---------- ---------------\n-h, --help none\n-m, --msg Quoted text with the msg being added to chat\n-l, --log An integer representing the number of rows you\'d like to view, default 5'
file_path=./test.txt
file_path=/var/spool/uucppublic/chat.txt
title="GAB v1.0"
last_date="Last message: $(date -r $file_path)"
HOST=`grep "nodename" /etc/uucp/config | tail -n1 | cut -f 2`
if [ -z "$1" ]
then
@ -27,9 +28,15 @@ else
echo "Must pass a quoted string w/ the msg flag"
exit 1
else
echo "$USER > $2" >> $file_path
echo "$USER@$HOST > $2" >> $file_path
if [ $? -eq 0 ]
then
for i in $(uuname);
do
set +H
uucp $file_path $i!~/chat.txt
done
echo "Successfully added text to chatlog"
exit 0
else