| 1234567891011121314151617181920212223242526272829303132333435 | #!/bin/bash# bootstrap clam av service and clam av database updater shell script# presented by mko (Markus Kosmal<code@cnfg.io>)set -m# start clam service itself and the updater in background as daemonfreshclam -d &clamd &# recognize PIDspidlist=`jobs -p`# initialize latest result varlatest_exit=0# define shutdown helperfunction shutdown() {    trap "" SUBS    for single in $pidlist; do        if ! kill -0 $pidlist 2>/dev/null; then            wait $pidlist            exitcode=$?        fi    done    kill $pidlist 2>/dev/null}# run shutdowntrap terminate SUBSwait# return received resultexit $latest_exit
 |