Code

Added server selection to fonreport plugin
[gosa.git] / debian / gosa.postinst
old mode 100755 (executable)
new mode 100644 (file)
index d00dcc2..cbeaca0
@@ -1,6 +1,10 @@
 #! /bin/sh
 # GOsa postinst script
 
+set -e
+
+#DEBHELPER#
+
 # We exit unless the package is being configured
 case "$1" in
         abort*upgrade)         exit 0;;
@@ -39,13 +43,21 @@ chown root.$WEBGROUP -R /var/spool/gosa
 chmod 770 -R /var/spool/gosa
 
 # Add links for safe mode
-for link in /usr/bin/convert /usr/bin/lpstat; do
-       [ -L $link ] || ln -sf $link /usr/share/gosa/bin/${link##*/}
+[ ! -d /usr/share/gosa/bin ] && mkdir -p /usr/share/gosa/bin
+for source in /usr/bin/convert /usr/bin/lpstat; do
+       if [ -e $source ]; then
+               target=/usr/share/gosa/bin/${source##*/}
+               [ ! -L $target ] && ln -sf $source $target
+       fi
 done
 
 # Finally restart servers
 for server in $servers; do
-       /etc/init.d/$server reload || /bin/true
+       if [ -x /usr/sbin/invoke-rc.d ]; then
+               invoke-rc.d $server restart
+       else
+               /etc/init.d/$server restart
+       fi
 done
 
 exit 0