I need to automate the updating of my license file in ssh


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin

I need to automate the updating of my license file in sshLast Modified: Feb 19, 2017, 8:38 pm
If you're on a LAN, or for whatever reason, DA itself cannot connect out to update your license, regular calls to getLicense.sh would be required.

You can automate this by editing:

/etc/cron.d/directadmin_cron

and add this line at the bottom of the file:

0 6 15 * * root /usr/local/directadmin/scripts/getLicense.sh 1234 56789; echo "action=directadmin&value=restart" >> /usr/local/directadmin/data/task.queue

Where 15 is the day of the month that the license will be updated.  You can pick any value you'd like, but it should usually be about 5 days before you need to update (so DA doesn't start making update calls, if it's just going to hit an error anyway)

Also replace 1234 with your client ID, and 56789 with your license ID.
You'll want to restart cron to be sure it loads in the new value

/etc/init.d/crond restart

Note, on FreeBSD, the cron file will be /etc/crontab.


If you're not able to connect to port 443 on directadmin.com (https), or are not getting any results (no returned data), it may be a block somewhere on 443.
For that case, you can try using port 80 to get the license.  To do this, type:

echo 1 > /root/.insecure_download

and the scripts will automatically download over port 80, without encryption.



NOTE

If you set your cron to run more often than is needed, our system will block your requests.
Do not run it every minute. Do not run it every hour.
Even daily is far more than required.
Portioned licenses last 30 days, so once per month should be plenty.
 
Related Helpfiles
Updating your DirectAdmin License manually
The task.queue is not being processed
What is a Portioned License?
Testing why the automated license update isn't working

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST