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