Compare commits

..

No commits in common. "08646a05d44a55d8f0ba3e65b7977a7cf8c7a1bb" and "06725dfcd507e0e99aefb313fe296a4f54813d10" have entirely different histories.

3 changed files with 30 additions and 37 deletions

9
heed
View file

@ -7,10 +7,11 @@ clear
echo "╻ ╻┏━╸┏━╸╺┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸" echo "╻ ╻┏━╸┏━╸╺┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸"
echo "┣━┫┣╸ ┣╸ ┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ " echo "┣━┫┣╸ ┣╸ ┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ "
echo "╹ ╹┗━╸┗━╸╺┻┛ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ " echo "╹ ╹┗━╸┗━╸╺┻┛ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ "
echo "Take heed, $USER! This is a group chat with everyone on the server!"
echo "You may post in chat with 'proclaim'!" echo "#######################################################################"
echo "You may view old chat with 'scry'!" echo " Take heed, $USER! This is a group chat with everyone on the server!"
echo "----------------------------------" echo " You can view earlier chat with 'scry'!"
echo "#######################################################################"
echo echo
tail -f $chatlog tail -f $chatlog

View file

@ -1,9 +1,14 @@
#!/bin/sh -e #!/bin/sh -e
# install.sh
installtarget=/usr/local/bin installtarget=/usr/local/bin
chatlogdir=/var/log/bunkchat chatlogdir=/var/log/bunkchat
chatlog=chat.log chatlog=chat.log
if ! [ "$(id -u)" = 0 ]; then
echo "ERROR: please run install with root permission" >&2
exit 1
fi
chattrfailed() { chattrfailed() {
set +e set +e
rm -rf $chatlogdir rm -rf $chatlogdir
@ -13,38 +18,26 @@ chattrfailed() {
exit 1 exit 1
} }
prep() { # do this setup first in case chattr fails
mkdir -p $chatlogdir # mk chat directory and touch file
chmod 755 $chatlogdir mkdir $chatlogdir
touch ${chatlogdir}/${chatlog} chmod 755 $chatlogdir
chmod 666 ${chatlogdir}/${chatlog}
# if chattr +a not supported on this file system, catch error and clean up
chattr +a ${chatlogdir}/${chatlog} || chattrfailed
}
install() { touch ${chatlogdir}/${chatlog}
cp proclaim heed scry $installtarget chmod 666 ${chatlogdir}/${chatlog}
chmod 755 ${installtarget}/proclaim # if chattr +a not supported on this file system catch error and clean up
chmod 755 ${installtarget}/heed chattr +a ${chatlogdir}/${chatlog} || chattrfailed
chmod 755 ${installtarget}/scry
chown root:root ${installtarget}/proclaim
chown root:root ${installtarget}/heed
chown root:root ${installtarget}/scry
echo "SUCCESS! bunkchat installed!" cp proclaim heed scry $installtarget
exit 0
}
# check for root perms chmod 755 ${installtarget}/proclaim
if ! [ "$(id -u)" = 0 ]; then chmod 755 ${installtarget}/heed
echo "ERROR: please run install with root permission" >&2 chmod 755 ${installtarget}/scry
exit 1
fi
# if chat.log exists, skip prep chown root:root ${installtarget}/proclaim
if [ -f ${chatlogdir}/${chatlog} ]; then chown root:root ${installtarget}/heed
install chown root:root ${installtarget}/scry
else
prep
install echo "SUCCESS! bunkchat installed!"
fi exit 0

View file

@ -23,7 +23,6 @@ do
echo "┏━┓┏━┓┏━┓┏━╸╻ ┏━┓╻┏┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸" echo "┏━┓┏━┓┏━┓┏━╸╻ ┏━┓╻┏┳┓ ┏┓ ╻ ╻┏┓╻╻┏ ┏━╸╻ ╻┏━┓╺┳╸"
echo "┣━┛┣┳┛┃ ┃┃ ┃ ┣━┫┃┃┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ " echo "┣━┛┣┳┛┃ ┃┃ ┃ ┣━┫┃┃┃┃ ╺━╸ ┣┻┓┃ ┃┃┗┫┣┻┓┃ ┣━┫┣━┫ ┃ "
echo "╹ ╹┗╸┗━┛┗━╸┗━╸╹ ╹╹╹ ╹ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ " echo "╹ ╹┗╸┗━┛┗━╸┗━╸╹ ╹╹╹ ╹ ┗━┛┗━┛╹ ╹╹ ╹┗━╸╹ ╹╹ ╹ ╹ "
echo "You may view current chat with 'heed'!"
echo "You may view old chat with 'scry'!" echo "You may view old chat with 'scry'!"
echo "----------------------------------" echo "----------------------------------"
printf "speak to the server: " printf "speak to the server: "