From ba83d01e95fad003364bc6f1d91140cac9f7e633 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sat, 8 Mar 2014 00:01:01 +0100 Subject: [PATCH] Better install scripts (debhelper on the start, simple if instead of case, ...). --- rocci-server/debian/postinst | 13 +++++-------- rocci-server/debian/{postrm => prerm} | 12 +++++------- 2 files changed, 10 insertions(+), 15 deletions(-) rename rocci-server/debian/{postrm => prerm} (64%) diff --git a/rocci-server/debian/postinst b/rocci-server/debian/postinst index aa148a9..ee48710 100644 --- a/rocci-server/debian/postinst +++ b/rocci-server/debian/postinst @@ -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 diff --git a/rocci-server/debian/postrm b/rocci-server/debian/prerm similarity index 64% rename from rocci-server/debian/postrm rename to rocci-server/debian/prerm index 7c9d63e..df1e3e8 100644 --- a/rocci-server/debian/postrm +++ b/rocci-server/debian/prerm @@ -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 -- 1.8.2.3