123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- pre_install() {
- echo "Cleaning any old chroots before installing a new one..."
- if [ -d '/srv/nginxchroot' ]; then
- umount /srv/nginxchroot/tmp
- umount /srv/nginxchroot/var/run
- rm -rf /srv/nginxchroot
- fi
- }
- post_install() {
- echo "Installing a new chroot ... "
- /bin/sh -c "/usr/libexec/nginx-hardened-scripts/nginxchroot.sh"
- wait
- echo "Done!"
- echo "====="
- echo "To use this service please disable nginx,"
- echo "then enable nginx-hardened via HyperRC or runit."
- echo "====="
- }
- post_upgrade() {
- echo "Stopping chrooted nginx..."
- if [ -x /etc/init.d/nginx-hardened ]; then
- /etc/init.d/nginx-hardened stop
- fi
-
- echo "Cleaning old chroot and putting in a new one..."
- if [ -d '/srv/nginxchroot' ]; then
- umount /srv/nginxchroot/tmp
- umount /srv/nginxchroot/var/run
- rm -rf /srv/nginxchroot
- fi
- wait
- /bin/sh -c "/usr/libexec/nginx-hardened-scripts/nginxchroot.sh"
- wait
- echo "Done!"
- echo "====="
- echo "To use this service please disable nginx,"
- echo "then enable nginx-hardened via HyperRC or runit."
- echo "====="
- }
- pre_remove() {
- echo "Stopping chrooted nginx..."
- if [ -x /etc/init.d/nginx-hardened ]; then
- /etc/init.d/nginx-hardened stop
- fi
- }
- post_remove() {
- echo "Deleting chroot..."
- if [ -d '/srv/nginxchroot' ]; then
- umount /srv/nginxchroot/tmp
- umount /srv/nginxchroot/var/run
- rm -rf /srv/nginxchroot
- fi
- wait
- echo "Done!"
- }
|