2020-05-26 21:15:31 -07:00
|
|
|
#!/usr/local/bin/bash
|
|
|
|
|
2020-02-25 11:28:31 -08:00
|
|
|
# Copyright (c) 2018-2020, diyIT.org
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
|
|
|
|
# https://diyit.org/license/
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2020-05-26 21:15:31 -07:00
|
|
|
web_jails=(cloud hub nivi rachna rishabh sharad web web-diyit ldap-mgr r-ldap-mgr monitor)
|
2020-02-25 11:28:31 -08:00
|
|
|
|
|
|
|
for i in ${web_jails[@]};
|
|
|
|
do
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "restarting apache in web_jail $i after SSL update"
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec $i "service apache24 restart"
|
|
|
|
done
|
|
|
|
|
|
|
|
ldap_jails=(ldap r-ldap)
|
|
|
|
|
|
|
|
for i in ${ldap_jails[@]};
|
|
|
|
do
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "restarting ldap in ldap_jail $i after SSL update"
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec $i "service slapd restart"
|
|
|
|
done
|
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "restarting haproxy in jail proxy after SSL update"
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec proxy "service haproxy reload"
|
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "restarting nginx in jail pkgp after SSL update"
|
|
|
|
iocage exec pkgp "service nginx reload"
|
|
|
|
|
|
|
|
echo "restarting mail in jail mail after SSL update"
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec mail "service postfix restart"
|
|
|
|
|
2020-04-11 00:46:09 -07:00
|
|
|
echo "restarting ELK in jail monitor after SSL update"
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec monitor "cp /mnt/certs/diy*.pem /usr/local/etc/elasticsearch/certs"
|
|
|
|
iocage exec monitor "cp /mnt/certs/cacert.pem /usr/local/etc/elasticsearch/certs"
|
|
|
|
iocage exec monitor "service elasticsearch restart"
|
|
|
|
iocage exec monitor "service kibana restart"
|
|
|
|
|
|
|
|
#iocage exec monitor "service logstash restart"
|
2020-05-26 21:15:31 -07:00
|
|
|
iocage exec monitor 'ps axww | grep logstash | cut -f1 -d" " | xargs -n 1 kill -9 '
|
2020-02-25 11:28:31 -08:00
|
|
|
iocage exec monitor "/root/start_logstash.sh"
|
|
|
|
|
|
|
|
iocage exec monitor "service heartbeat restart"
|