]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix post install and post remove script
authorBastian Dehn <hhaalo@arcor.de>
Wed, 15 Jul 2026 15:20:58 +0000 (17:20 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 15 Jul 2026 15:20:58 +0000 (17:20 +0200)
src/debian/postinst
src/debian/postrm

index 1fa6c54b1aab2b96682401fb2e583fd02e9d515d..fa90e2a4433222b6a6dda9430d571fcbeadab996 100755 (executable)
@@ -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
 
index 5744cc8fb92a7950ff509e14e4f274ca45489edc..b6589bbbabe80c814e9bb3d46ef721d9ecb760fa 100755 (executable)
@@ -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"  \