Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ioguix:check_pgactivity
naemon
_service:extract_file:debian.naemon-thruk.postinst
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:extract_file:debian.naemon-thruk.postinst of Package naemon
#!/bin/sh # postinst script for thruk # # see: dh_installdeb(1) # check if apache is installed and needs configuring (nginx is alternative) dpkg -s apache2 >/dev/null 2>&1 [ $? = 0 ] && CONFIGURE_APACHE=true || CONFIGURE_APACHE=false set -e # summary of how this script can be called: # * <postinst> `configure' <most-recently-configured-version> # * <old-postinst> `abort-upgrade' <new version> # * <conflictor's-postinst> `abort-remove' `in-favour' <package> # <new-version> # * <postinst> `abort-remove' # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' # <failed-install-package> <version> `removing' # <conflicting-package> <version> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) mkdir -p /etc/thruk/ [ ! -e /etc/naemon/cgi.cfg ] || mv /etc/naemon/cgi.cfg /etc/thruk/cgi.cfg [ ! -e /etc/naemon/thruk_local.conf ] || mv /etc/naemon/thruk_local.conf /etc/thruk/thruk_local.d/_migrated_naemon_thruk_local.conf [ ! -e /etc/naemon/menu_local.conf ] || sed -e 's%/usr/share/naemon/%/usr/share/thruk/%g' -i /etc/naemon/menu_local.conf [ ! -e /etc/naemon/menu_local.conf ] || mv /etc/naemon/menu_local.conf /etc/thruk/menu_local.conf [ ! -e /etc/naemon/htpasswd ] || mv /etc/naemon/htpasswd /etc/thruk/htpasswd [ -e /etc/naemon/conf.d/thruk_templates.cfg ] || ln -sfn /usr/share/thruk/support/thruk_templates.cfg /etc/naemon/conf.d/thruk_templates.cfg if $CONFIGURE_APACHE; then # enable naemon redirect if [ -x '/usr/sbin/a2enconf' ]; then [ -f /etc/apache2/conf-enabled/naemon.conf ] || /usr/sbin/a2enconf naemon fi # activate cookie in existing default virtual hosts set +e ls -1 /etc/apache2/sites-available/*default* | \ while read file; do if ! grep naemon-thruk.include $file >/dev/null 2>&1; then sed -i -e 's|</VirtualHost>|\n Include /usr/share/naemon/naemon-thruk.include\n</VirtualHost>|g' $file fi done set -e # add apache user to group naemon so thruk can access the livestatus socket if /usr/bin/id www-data &>/dev/null; then if ! /usr/bin/id -Gn www-data 2>/dev/null | grep -q naemon ; then /usr/bin/gpasswd -a www-data naemon >/dev/null fi fi # restart apache if which invoke-rc.d >/dev/null 2>&1; then invoke-rc.d apache2 restart || true else /etc/init.d/apache2 restart || true fi fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor