Check crontab to avoid adding the job multiple times
This commit is contained in:
@@ -63,8 +63,12 @@ then
|
|||||||
|
|
||||||
# Add daily update to cron
|
# Add daily update to cron
|
||||||
crontab -l > tempcron
|
crontab -l > tempcron
|
||||||
echo "0 1 * * * /etc/openvpn/updateFreeVPN.sh" > tempcron
|
|
||||||
crontab tempcron
|
grep updateFreeVPN tempcron > /dev/null 2>&1
|
||||||
|
if [[ $? == 1 ]]; then
|
||||||
|
echo "0 1 * * * /etc/openvpn/updateFreeVPN.sh" > tempcron
|
||||||
|
crontab tempcron
|
||||||
|
fi
|
||||||
rm tempcron
|
rm tempcron
|
||||||
elif [[ "${OPENVPN_PROVIDER^^}" = "VPNBOOK" ]]
|
elif [[ "${OPENVPN_PROVIDER^^}" = "VPNBOOK" ]]
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user