From 92594be302c8b30980e2c917f792604205671ebf Mon Sep 17 00:00:00 2001 From: DanB Date: Fri, 29 Nov 2013 19:23:56 +0100 Subject: [PATCH] Small modifications in debian pkg --- data/pkg/pkg_cgrates_deb.sh | 1 + data/pkg/skel/DEBIAN/cgrates.postinst | 47 ++++++++++++++++++++------- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/data/pkg/pkg_cgrates_deb.sh b/data/pkg/pkg_cgrates_deb.sh index 2980fc02b..b768a546a 100755 --- a/data/pkg/pkg_cgrates_deb.sh +++ b/data/pkg/pkg_cgrates_deb.sh @@ -19,5 +19,6 @@ cp -r ../../data/ $PKG_DIR/usr/share/cgrates/ mkdir -p $PKG_DIR/usr/bin cp /usr/local/goapps/bin/cgr-* $PKG_DIR/usr/bin/ mkdir -p $PKG_DIR/var/log/cgrates/cdr/out +mkdir -p $PKG_DIR/var/log/cgrates/history dpkg-deb --build $PKG_DIR diff --git a/data/pkg/skel/DEBIAN/cgrates.postinst b/data/pkg/skel/DEBIAN/cgrates.postinst index 0b6b8a50d..7672858dd 100755 --- a/data/pkg/skel/DEBIAN/cgrates.postinst +++ b/data/pkg/skel/DEBIAN/cgrates.postinst @@ -1,21 +1,46 @@ -#!/bin/bash +#! /bin/sh +# +# $Id$ + +PKG=cgrates -### CGRateS debian postinstall script - set -e - + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + case "$1" in + configure) - adduser --quiet --system --group --disabled-password --shell /bin/false --home /var/run/cgrates --gecos "CGRateS" cgrates + adduser --quiet --system --group --disabled-password --shell /bin/false --home /var/run/cgrates --gecos "CGRateS" cgrates || true chown -R cgrates /var/log/cgrates/ chown -R cgrates /usr/share/cgrates/ - ;; + ;; + abort-upgrade|abort-remove|abort-deconfigure) - echo "$1" + ;; - *) - echo "postinst called with unknown argument \`\$1'" >&2 - exit 0 + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 ;; esac - + +#DEBHELPER# +