check_oracle_health: update to 1.9.3.5
[omd.git] / packages / nagvis / NAGVIS_UPDATE.hook
blobaa74a6510714278b81ee3d7cdb2fac1ca79b1254
1 #!/bin/bash
2 # This hook is meant to help the user to update their OMD instances running
3 # NagVis 1.5 to NagVis 1.6. The main reason for this hook is the change of
4 # the var/nagvis/userfiles directory to share/nagvis/htdocs/userfiles for
5 # delivered files and local/share/nagvis/htdocs/userfiles for individual
6 # files.
7 # It is not simply copying the contents of the old directory to the new
8 # directory. During update only the customized files must be moved. Otherwise
9 # the files in the local path would override the ones in the default path.
11 # The easiest solution for this is to create a hook which runs once for each
12 # instance. Since we can not easily provide a hook for downgrading, we only
13 # handle the upgrade from 1.5 to 1.6x and leave the old files where they are.
15 # Skip this when already copied once
16 if [ ! -d $OMD_ROOT/var/nagvis/userfiles ] \
17 || [ -e $OMD_ROOT/var/nagvis/userfiles/.copied ]; then
18 exit 0
21 case "$1" in
22 refresh)
23 # Copy while excluding standard NagVis files
24 rsync -a -f "- images/maps/*demo*.png" \
25 -f "- images/iconsets/20x20.gif" \
26 -f "- images/iconsets/error.png" \
27 -f "- images/iconsets/configerror_*.png" \
28 -f "- images/iconsets/demo_*.png" \
29 -f "- images/iconsets/std_*.png" \
30 -f "- images/templates/default*" \
31 -f "- images/shapes/demo*.png" \
32 -f "- templates/default.*" \
33 -f "- gadgets/gadgets_core.php" \
34 -f "- gadgets/std_*.php" \
35 -f "- sounds/std_*.mp3" \
36 $OMD_ROOT/var/nagvis/userfiles/ \
37 $OMD_ROOT/local/share/nagvis/htdocs/userfiles
38 touch $OMD_ROOT/var/nagvis/userfiles/.copied
40 esac
42 exit 0