From 6a91c51a1b0a19f9b14e6fa1e11d57dc2538fc32 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Wed, 15 Jul 2026 17:20:58 +0200 Subject: [PATCH] fix post install and post remove script --- src/debian/postinst | 10 ++-------- src/debian/postrm | 9 +++------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/debian/postinst b/src/debian/postinst index 1fa6c54..fa90e2a 100755 --- a/src/debian/postinst +++ b/src/debian/postinst @@ -16,20 +16,14 @@ main() { local DLLCONFIG="/etc/sane.d/dll.conf" local ENTRY="kds_s2000w_net" - local entrycheck= [ -f "$DLLCONFIG" ] \ || errlog "ERROR: $DLLCONFIG does not exist" \ || return 0 echo "found $DLLCONFIG" - entrycheck=$(cat $DLLCONFIG | grep $ENTRY) - - [ -n "$entrycheck" ] \ - && echo "$ENTRY entry exists in $DLLCONFIG" \ - && return 0 - - sed -i "\$a$ENTRY" $DLLCONFIG \ + cat $DLLCONFIG | grep $ENTRY \ + || sed -i "\$a$ENTRY" $DLLCONFIG \ || errlog "could not add entry $ENTRY to $DLLCONFIG" \ || return 0 diff --git a/src/debian/postrm b/src/debian/postrm index 5744cc8..b6589bb 100755 --- a/src/debian/postrm +++ b/src/debian/postrm @@ -16,18 +16,15 @@ main() { local DLLCONFIG="/etc/sane.d/dll.conf" local ENTRY="kds_s2000w_net" - local entrycheck= [ -f "$DLLCONFIG" ] \ || errlog "ERROR: $DLLCONFIG does not exist" \ || return 0 echo "found $DLLCONFIG" - entrycheck=$(cat $DLLCONFIG | grep $ENTRY) - - [ -z "$entrycheck" ] \ - && echo "$ENTRY entry does not exists in $DLLCONFIG" \ - && return 0 + cat $DLLCONFIG | grep $ENTRY \ + || errlog "$ENTRY entry does not exists in $DLLCONFIG" \ + || return 0 sed -i "/$ENTRY/d" $DLLCONFIG \ || errlog "could not remove $ENTRY from $DLLCONFIG" \ -- 2.47.3