added tls to script
added a cron friendly script