diff --git a/manage-pat-functions b/manage-pat-functions index d509d41..edf2589 100644 --- a/manage-pat-functions +++ b/manage-pat-functions @@ -180,89 +180,6 @@ exit 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="Email Backup 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="Email Restore 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="Email Restore by KM4ACK\r\rRESTORE COMPLETE" \ ---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="Email Restore by KM4ACK\r\rNot a valid restore directory" \ ---button=gtk-ok -fi -exit - -} - - - - RESTORECONFIG(){ CONFIG=$HOME/.wl2k/config.json OUTFILE=/run/user/$UID/config.list