Better install scripts (debhelper on the start, simple if instead of case, ...).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 7 Mar 2014 23:01:01 +0000 (00:01 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Fri, 7 Mar 2014 23:01:01 +0000 (00:01 +0100)
rocci-server/debian/postinst
rocci-server/debian/prerm [moved from rocci-server/debian/postrm with 64% similarity]

index aa148a9..ee48710 100644 (file)
@@ -1,13 +1,11 @@
 #!/bin/sh
 set -e
 
-case "$1" in
-configure|reconfigure)
-       ;;
-*)
+#DEBHELPER#
+
+if [ "$1" != "configure" -a "$1" != "reconfigure" ]; then
        exit 0
-       ;;
-esac
+fi
 
 conf="/etc/apache2/sites-available/occi-ssl"
 econf="/etc/apache2/sites-enabled/occi-ssl"
@@ -37,7 +35,6 @@ else
        echo "Hostname could not be determined! Please update 'ServerName' and 'ROCCI_SERVER_HOSTNAME' in $conf."
 fi
 
-# apache reload
 if [ -n "$2" ]; then
 # we're upgrading. test if we're enabled, and if so, restart to reload the module.
        if [ -e "$econf" ]; then
@@ -53,4 +50,4 @@ if [ -e /etc/apache2/apache2.conf ]; then
        reload_apache
 fi
 
-#DEBHELPER#
+exit 0
similarity index 64%
rename from rocci-server/debian/postrm
rename to rocci-server/debian/prerm
index 7c9d63e..df1e3e8 100644 (file)
@@ -1,16 +1,14 @@
 #!/bin/sh
 set -e
 
-case "$1" in
-remove|purge)
-       ;;
-*)
+#DEBHELPER#
+
+if [ "$1" != "remove" -a "$1" != "purge" ]; then
        exit 0
-       ;;
-esac
+fi
 
 if [ -e /etc/apache2/apache2.conf ]; then
        a2dissite occi-ssl || :
 fi
 
-#DEBHELPER#
+exit 0