Skip to content

Instantly share code, notes, and snippets.

@jmervine jmervine/restart.rb
Last active Jun 13, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.