Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/bin/bash
#declare mailbox folder name and extension
MBOXNAME="HG4211"
WAVEXT='*.wav'
echo 'Mbox Name: '$MBOXNAME
echo 'File Ext: '$WAVEXT
echo 'Cleaning Mailbox Directory...'
#check backup folder and create if it does not exist
if [ ! -d /usr/etc/opt_bak/"$MBOXNAME" ]; then
echo 'Directory /usr/etc/opt_bak/'"$MBOXNAME"' does not exist. Creating...'
mkdir /usr/etc/opt_bak/"$MBOXNAME"
else
echo 'Directory /usr/etc/opt_bak/'"$MBOXNAME"' already exists. Continuing...'
fi
#make a backup of the mailbox folder
cp /opt/vmpro/Accounts/"$MBOXNAME"/$WAVEXT /usr/etc/opt_bak/"$MBOXNAME"
#store result of copy
COPYRESULT=$?
#check result of copy
if [ $COPYRESULT -eq 0 ]; then
echo 'Successfully copied files from /opt/vmpro/Accounts/'"$MBOXNAME"' to /usr/etc/opt_bak/'"$MBOXNAME"
else
echo 'File copy failed, exit code '$COPYRESULT
fi
echo 'Deleting wav files from /opt/vmpro/Accounts/'"$MBOXNAME"
#find and delete any files with extension $WAVEXT with minimum age of 600 min (10 hours)
find /opt/vmpro/Accounts/"$MBOXNAME" -daystart -maxdepth 1 -mmin +600 -type f -name $WAVEXT -delete
#store result of deletion
DELRESULT=$?
#check result of deletion
if [ $DELRESULT -eq 0 ]; then
echo 'Directory /opt/vmpro/Accounts/'"$MBOXNAME"' Cleaned Successfully'
else
echo 'Error in Cleaning. Please Manually Check.'
fi
echo 'Deleting txt files from /opt/vmpro/Accounts/'"$MBOXNAME"