1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-19 08:10:12 -07:00

remove bkup and restore

This commit is contained in:
KM4ACK 2021-02-18 18:46:51 -06:00
parent 9de24cf724
commit 20496f9f9b

View File

@ -180,89 +180,6 @@ exit
fi fi
} }
EMAILBKUP(){
CONFIG=$HOME/.wl2k/config.json
WHO=$(whoami)
CALL=$(cat $HOME/.wl2k/config.json | grep -m 1 mycall | sed 's/\"mycall\": \"//' | sed 's/\",//' | sed -e 's/^\s*//' | tr '[:lower:]' '[:upper:]')
BKUPTIME=$(date +%Y%d%m-%H%M)
BACKUP=$(yad --form --width=420 --text-align=center --center --title="Email Backup" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Email Backup</b> by KM4ACK" \
--field="Backup Directory":DIR \
--button="Backup Emails":2 \
--button="Cancel":1)
BUT=$?
if [ $BUT = 252 ]; then
exit
elif [ $BUT = 1 ]; then
$MAIN
exit
fi
DIR=$(echo $BACKUP | awk -F "|" '{print $1}')
cp -r $HOME/.wl2k/mailbox/$CALL $DIR/email.bkup.$BKUPTIME
if [ -d $DIR/email.bkup.$BKUPTIME ]; then
yad --center --text="Backup Complete" \
--button=gtk-ok
$MAIN &
exit
fi
}
EMAILRESTORE(){
MYPATH=$HOME/dev/patmenu2
CONFIG=$HOME/.wl2k/config.json
WHO=$(whoami)
CALL=$(cat $HOME/.wl2k/config.json | grep -m 1 mycall | sed 's/\"mycall\": \"//' | sed 's/\",//' | sed -e 's/^\s*//' | tr '[:lower:]' '[:upper:]')
RESTORE=$(yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Email Restore</b> by KM4ACK" \
--field="Restore Directory":DIR \
--button="Restore Emails":2 \
--button="Cancel":1)
BUT=$?
if [ $BUT = 252 ]; then
exit
elif [ $BUT = 1 ]; then
$MAIN
exit
fi
DIR=$(echo $RESTORE | awk -F "|" '{print $1}')
DIRCHECK=$(ls $DIR)
COUNT=${#DIRCHECK}
if [ "$COUNT" = 19 ]; then
cp $DIR/archive/* $HOME/.wl2k/mailbox/$CALL/archive/
cp $DIR/in/* $HOME/.wl2k/mailbox/$CALL/in/
cp $DIR/out/* $HOME/.wl2k/mailbox/$CALL/out/
cp $DIR/sent/* $HOME/.wl2k/mailbox/$CALL/sent/
yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Email Restore</b> by KM4ACK\r\r<b>RESTORE COMPLETE</b>" \
--button=gtk-ok
else
yad --form --width=420 --text-align=center --center --title="Email Restore" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Email Restore</b> by KM4ACK\r\r<b>Not a valid restore directory</b>" \
--button=gtk-ok
fi
exit
}
RESTORECONFIG(){ RESTORECONFIG(){
CONFIG=$HOME/.wl2k/config.json CONFIG=$HOME/.wl2k/config.json
OUTFILE=/run/user/$UID/config.list OUTFILE=/run/user/$UID/config.list