#!/bin/bash
-
set -e
-errlog()
-{
- local lastexit=$?
- local msg="$1"
-
- echo "ERROR: $msg"
-
- return $lastexit
-}
-
main()
{
DLLCONFIG=${DLLCONFIG:="/etc/sane.d/dll.conf"}
local entry_count=
local ENTRY="kds_s2000w_net"
- [ -f "$DLLCONFIG" ] \
- || errlog "$DLLCONFIG does not exist" \
- || return 0
+ [ ! -f "$DLLCONFIG" ] \
+ && echo "ERROR: $DLLCONFIG does not exist" \
+ && return 0
echo "found $DLLCONFIG"
grep --silent "$ENTRY" "$DLLCONFIG" || echo "$ENTRY" >> "$DLLCONFIG"