From cc2bda94b0c1ac476432716e7c0c2a83b8e9b4c7 Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Wed, 8 Mar 2023 15:15:05 -0800 Subject: reverted change to getlogs, as it contained modified server path --- sh/getlogs | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'sh/getlogs') 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 -- cgit v1.3.1