diff --git a/debian/weatherstation-chart.postrm b/debian/weatherstation-chart.postrm index e9652f0..c85c17c 100644 --- a/debian/weatherstation-chart.postrm +++ b/debian/weatherstation-chart.postrm @@ -1,11 +1,12 @@ #!/bin/sh #DEBHELPER# - -if getent passwd weatherstation >/dev/null 2>&1; then - echo -n "delete user weatherstation ... " - deluser --quiet weatherstation 2>/dev/null || true - echo "done" +if ( [ ! -e /etc/weatherstation/checksensor.conf ] && [ ! -e /etc/weatherstation/weatherd.conf ] && [ ! -e /etc/weatherstation/frontend.conf ] ); then + if getent passwd weatherstation >/dev/null 2>&1; then + echo -n "delete user weatherstation ... " + deluser --quiet weatherstation 2>/dev/null || true + echo "done" + fi fi if [ -e /etc/weatherstation/frontend.conf ]; then diff --git a/debian/weatherstation-checksensor.postrm b/debian/weatherstation-checksensor.postrm index 7813d25..2564e24 100644 --- a/debian/weatherstation-checksensor.postrm +++ b/debian/weatherstation-checksensor.postrm @@ -2,8 +2,10 @@ #DEBHELPER# -if getent passwd weatherstation >/dev/null 2>&1; then - echo -n "delete user weatherstation ... " - deluser --quiet weatherstation 2>/dev/null || true - echo "done" +if ( [ ! -e /etc/weatherstation/chart.conf ] && [ ! -e /etc/weatherstation/weatherd.conf ] && [ ! -e /etc/weatherstation/frontend.conf ] ); then + if getent passwd weatherstation >/dev/null 2>&1; then + echo -n "delete user weatherstation ... " + deluser --quiet weatherstation 2>/dev/null || true + echo "done" + fi fi diff --git a/debian/weatherstation-frontend.postrm b/debian/weatherstation-frontend.postrm new file mode 100644 index 0000000..ee5833c --- /dev/null +++ b/debian/weatherstation-frontend.postrm @@ -0,0 +1,12 @@ +#!/bin/sh + +#DEBHELPER# +if ( [ ! -e /etc/weatherstation/checksensor.conf ] && [ ! -e /etc/weatherstation/weatherd.conf ] && [ ! -e /etc/weatherstation/chart.conf ] ); then + if getent passwd weatherstation >/dev/null 2>&1; then + echo -n "delete user weatherstation ... " + deluser --quiet weatherstation 2>/dev/null || true + echo "done" + fi +fi + + diff --git a/debian/weatherstation-weatherd.postrm b/debian/weatherstation-weatherd.postrm index 3f881a6..3766356 100644 --- a/debian/weatherstation-weatherd.postrm +++ b/debian/weatherstation-weatherd.postrm @@ -2,9 +2,12 @@ #DEBHELPER# -if getent passwd weatherstation >/dev/null 2>&1; then - echo -n "delete user weatherstation ... " - deluser --quiet weatherstation dailout 2>/dev/null || true - deluser --quiet weatherstation 2>/dev/null || true - echo "done" +deluser --quiet weatherstation dailout 2>/dev/null || true + +if ( [ ! -e /etc/weatherstation/chart.conf ] && [ ! -e /etc/weatherstation/checksensor.conf ] && [ ! -e /etc/weatherstation/frontend.conf ] ); then + if getent passwd weatherstation >/dev/null 2>&1; then + echo -n "delete user weatherstation ... " + deluser --quiet weatherstation 2>/dev/null || true + echo "done" + fi fi