Skip to content

Instantly share code, notes, and snippets.

@jmervine
Last active June 13, 2017 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmervine/41a24198dcfd2ccd322c9ffe3a3e7228 to your computer and use it in GitHub Desktop.
Save jmervine/41a24198dcfd2ccd322c9ffe3a3e7228 to your computer and use it in GitHub Desktop.
fake_rand = `hostname`.hash % 6
if config["STUNNEL_AUTORESTART"]
cron "stunnel-restart cron job" do
command "/sbin/restart stunnel-mod-gearman-worker-ssl"
minute [0, 15, 30, 45].map { |i| fake_rand + i }.join(", ")
mailto "srtools@heroku.com"
user "root"
action :create
end
else
cron "stunnel-restart cron job" do
command "/sbin/restart stunnel-mod-gearman-worker-ssl"
minute [0, 15, 30, 45].map { |i| fake_rand + i }.join(", ")
mailto "srtools@heroku.com"
user "root"
action :delete
end
end
# or not
if config["STUNNEL_AUTORESTART"]
cron "stunnel-restart cron job" do
command "/sbin/restart stunnel-mod-gearman-worker-ssl"
minute "*/15"
mailto "srtools@heroku.com"
user "root"
action :create
end
else
cron "stunnel-restart cron job" do
command "/sbin/restart stunnel-mod-gearman-worker-ssl"
minute "*/15"
mailto "srtools@heroku.com"
user "root"
action :delete
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment