diff options
author | Cecil <knoppmyth@gmail.com> | 2011-12-09 17:18:27 (GMT) |
---|---|---|
committer | Cecil <knoppmyth@gmail.com> | 2011-12-09 17:18:27 (GMT) |
commit | c034db2c880091379f7e58c2938a9689d78fbaa9 (patch) | |
tree | 8a074205a2f3bf6ee7fb5945c53e1a1618d41973 /abs/core/xymon/xymon.install | |
parent | 73b42144585c603fc64e7b1d6a126ceb7c486870 (diff) | |
parent | b0c5755ade92ee5b76a6d56248e64254876bc931 (diff) | |
download | linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.zip linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.tar.gz linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.tar.bz2 |
Merge branch 'testing' of ssh://cesman@linhes.org/mount/repository/linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/xymon/xymon.install')
-rw-r--r-- | abs/core/xymon/xymon.install | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/abs/core/xymon/xymon.install b/abs/core/xymon/xymon.install new file mode 100644 index 0000000..08fbd8c --- /dev/null +++ b/abs/core/xymon/xymon.install @@ -0,0 +1,68 @@ +post_install() { + . /etc/systemconfig + if [ ! -f /data/srv/xymon/server/ext/ignoreclient.py ] + then + echo "#this is a list of hosts to ignore" > /data/srv/xymon/server/ext/ignoreclient.py + echo ignorehosts=\"\'ignoreme1\',\'ignoreme2\'\" >> /data/srv/xymon/server/ext/ignoreclient.py + fi + + if [ ! -f /data/srv/httpd/htdocs/failed_func_hosts ] + then + touch /data/srv/httpd/htdocs/failed_func_hosts + fi + chown nobody:nobody /data/srv/httpd/htdocs/failed_func_hosts + chmod 777 /data/srv/httpd/htdocs/failed_func_hosts + + + sed -i -e "s/localhost/$hostname/" /data/srv/xymon/server/etc/hosts.cfg + sed -i -e "s/\#/\# func/" /data/srv/xymon/server/etc/hosts.cfg + sed -i -e "s/localhost/$hostname/" /data/srv/xymon/server/etc/xymonserver.cfg + chown -R nobody /data/srv/xymon + chown -R nobody /data/srv/httpd/htdocs/xymon + chown -R nobody /var/log/hobbit + chown root /data/srv/xymon/server/bin/xymonping + chmod +s /data/srv/xymon/server/bin/xymonping + echo "Adding sudo permissions for nobody {certmaster-ca}" + echo "Adding sudo permissions for http {backup_job}" + LINE="nobody ALL = NOPASSWD:/usr/bin/certmaster-ca" + LINE1="http ALL = NOPASSWD:/usr/MythVantage/bin/backup_job" + + for i in "$LINE" "$LINE1" + do + cp /etc/sudoers /etc/sudoers.bak + grep -q "$i" /etc/sudoers + if [ $? != 0 ] + then + echo "$i" >> /etc/sudoers + visudo -cf /etc/sudoers + if [ ! $? = 0 ] + then + cp /etc/sudoers.bak /etc/sudoers + echo $i + echo "Error adding files" + exit 1 + fi + fi + done + + + + + +} + +post_upgrade() { + post_install $1 +} + +post_remove() { + rm -f /data/srv/httpd/htdocs/xymon/index.html +} + +pre_remove() { + /bin/true +} +op=$1 +shift +$op $* +# vim: ft=sh ts=2 |