Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MovetoPat has wrong mailbox path #8 #9

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions movetopat
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,23 @@
#20180406 km4ack
#20190106 edited by kf7itf
#20211203 edited by KM4ACK
#20221223 edited by KQ4AFY
#script should be run by cron every
#minute.

CONFIG=/home/pi/.config/pat/config.json

#sets the MYCALL variable by reading the info from ~/.wl2k/config.json file for the configured operator.
MYCALL=$(awk '/"mycall": "/{print}' $CONFIG |grep -o -P '(?<=mycall": ").*(?=",)' | tr '[:lower:]' '[:upper:]')
# sets environment variables from pat
eval $(pat env)

CHECK=$(ls /var/www/html/emails/)

#check if files are in directory
if [ -z "$CHECK" ]
then
#exit if files not found
exit 0
#exit if files not found
exit 0
else
#move the files if found
sudo mv /var/www/html/emails/*.b2f $HOME/.local/share/pat/mailbox/$MYCALL/out
#move the files if found
sudo mv /var/www/html/emails/*.b2f ${PAT_MAILBOX_PATH}/${PAT_MYCALL}/out/
fi





exit 0