summaryrefslogtreecommitdiff
path: root/sh/getlogs
diff options
context:
space:
mode:
Diffstat (limited to 'sh/getlogs')
-rwxr-xr-xsh/getlogs30
1 files changed, 17 insertions, 13 deletions
diff --git a/sh/getlogs b/sh/getlogs
index 349c5ac..d651fe5 100755
--- a/sh/getlogs
+++ b/sh/getlogs
@@ -1,25 +1,29 @@
-USER=AberrantFlux
-REMOTELOGDIR=zncu@aberrantflux.xyz:/home/zncu/.znc/moddata/log/$USER/
-LOGDIR=~/log/irc
+#!/bin/sh
+USER=LiCoO2
+REMOTELOGDIR="root@prestonpan.tech:/home/preston/.znc/users/$USER/networks/AndreiNet/moddata/log"
+LOGDIR=~/.local/share/log/irc
NETWORK=AndreiNet
-rsync -avzP --rsh=ssh $REMOTELOGDIR $LOGDIR/$USER
+rsync -avzP "$REMOTELOGDIR" "$LOGDIR/$USER"
echo "Logs available for:"
-echo
-for CHANNEL in $LOGDIR/$USER/$NETWORK/*
+echo ""
+
+for CHANNEL in $LOGDIR/$USER/log/*
do
- DATE=$(date -r $CHANNEL +"%Y-%m-%d %H:%M")
- NAME="$(basename $CHANNEL)"
- echo "$NAME - last edited $DATE"
+ NAME="$(basename "$CHANNEL")"
+ # DATE=$(date -r $CHANNEL +"%Y-%m-%d %H:%M")
+ echo "$NAME"
done
+
while :
do
CHANNELSELECTION=exit
- read -p "Enter the name of a channel to read the most recent log: [exit] " CHANNELSELECTION
+ printf "Enter the name of a channel to read the most recent log: [exit] "
+ read CHANNELSELECTION
CHANNELSELCTION="${CHANNELSELECTION:=exit}"
- if [ $CHANNELSELCTION = exit ];
+ if [ "$CHANNELSELCTION" = exit ];
then
break
fi
- LASTLOG="$(ls -t $LOGDIR/$USER/$NETWORK/$CHANNELSELECTION | head -n1)"
- less $LOGDIR/$USER/$NETWORK/$CHANNELSELECTION/$LASTLOG
+ LASTLOG="$(ls -t "$LOGDIR/$USER/log/$CHANNELSELECTION" | head -n1)"
+ less "$LOGDIR/$USER/log/$CHANNELSELECTION/$LASTLOG"
done