-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added installer/uninstaller/upgrader #134
base: master
Are you sure you want to change the base?
Conversation
So open `/etc/cron.d/certbot` with your favourite editor and **comment the last line**. To disable systemd timers run: | ||
So open `/etc/cron.d/certbot` with your favourite editor and **comment the last line** or use the below sed command to do so as root. | ||
``` | ||
sed -i '/certbot -q renew/s/^/#/g' /etc/cron.d/certbot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing this and seems like the file usually has something like the below in it from the server's ive seen.
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew
Command works to do this.
#0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew
```bash | ||
wget -O /usr/local/bin/certbot_zimbra.sh https://github.com/YetOpen/certbot-zimbra/raw/master/certbot_zimbra.sh; | ||
chmod +x /usr/local/bin/certbot_zimbra.sh; | ||
wget -O /etc/cron.d/zimbracrontab https://github.com/YetOpen/certbot-zimbra/raw/masterzimbracrontab; | ||
chmod +x /etc/cron.d/zimbracrontab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added these snippets from Readme to the repo so they can be easily updated in future without lots of manual editing or stuff like the below.
cat >> /etc/cron.d/zimbracrontab <<-EOL
# certbot_zimbra.sh requires bash and a path with /usr/sbin
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Replace /usr/bin/certbot with the location of your certbot binary, use this to find it: which certbot-auto certbot letsencrypt
12 5 * * * root /usr/bin/certbot renew --pre-hook "/usr/local/bin/certbot_zimbra.sh -p" --deploy-hook "/usr/local/bin/certbot_zimbra.sh -d"
EOL
Thank you for sharing this, I'll review asap. One question at first sight: are all the OS checks necessary? Isn't it enough to check if Zimbra itself is installed, is it? |
I copied them from my other zimbra installer script so it was convenient but your right its probably unnecessary in hindsight. So feel free to pull anything out or modify as you see fit. |
I agree this would be a good enhancement to have, but in a simpler form than in this PR.
Things I like:
Neutral, to think about:
|
Added installer/uninstaller/upgrader for ease of use left the argbash stuff in there in case you wanted to easily mod it you can do so.
Should make upgrades installs and in rare case someone wants to uninstall it for some odd reason easier.
Also added the other inline scripts and unit files to the repo so they can be versioned and easily upgraded in future via this helper script if desired.
I have been using this amazing certbot_zimbra from you for awhile and was just overhauling and writing a new zimbra automated installation script so figured I would share the tweaks and code since it was compatible with stuff already for the most part.
If you haven't tried argbash before its a real treat to work with for new stuff. I hadn't heard about and been scripting for years and really makes it easy and fun to contribute where parsing is normally a nightmare which takes longer then the rest of the code does...