-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathw2c-letsencrypt
59 lines (47 loc) · 1.06 KB
/
w2c-letsencrypt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
#
# Copyright (c) Johannes Feichtner <[email protected]>
# Released under the GNU GPLv3 License.
#
# chkconfig: on 99 99
# description: Letsencrypt for ESXi
#
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
log() {
echo "$@"
logger -p daemon.info -t "$0" "$@"
}
for action in "$@"; do
log "Running '${action}' action";
case "$action" in
start)
/opt/w2c-letsencrypt/renew.sh
;;
remove)
sed -i '/\/opt\/w2c-letsencrypt/d' /var/spool/cron/crontabs/root
sed -i '/acme-challenge/d' /etc/vmware/rhttpproxy/endpoints.conf
/sbin/generate-certificates
for s in /etc/init.d/*; do if $s | grep ssl_reset > /dev/null; then $s ssl_reset; fi; done
;;
stop)
true
;;
status)
true
;;
install)
true
;;
upgrade)
true
;;
restart)
"$0" stop
"$0" start
;;
*)
echo "Usage: $(basename "$0") {start|stop|status|restart}"
exit 1
esac
done
exit 0