Check crontab to avoid adding the job multiple times
This commit is contained in:
		| @@ -63,8 +63,12 @@ then | ||||
|      | ||||
|     # Add daily update to cron | ||||
|     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 | ||||
| elif [[ "${OPENVPN_PROVIDER^^}" = "VPNBOOK" ]] | ||||
| then | ||||
|   | ||||
		Reference in New Issue
	
	Block a user