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
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
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