Tags » Bytes

OPSI | software inventory | list clients having software versions installed

#!/bin/bash

red='33}"
VERSION="${ARRAY[1]}"
echo -ne "${red}$NAME${NC} | ${purple}$VERSION${NC} | "
echo "select clientId from SOFTWARE_CONFIG where name = '$NAME' and version = '$VERSION';" | mysql -B -N -u${USER} -p${PASS} -D opsi | xargs echo -n… 56 more words

Bytes

TCPKILL | Scripting mode - batch mode

TKILL_ID_SEM="/tmp/tcpkill.$(date +%s).$RANDOM"
test -f $TKILL_ID_SEM && rm -f $TKILL_ID_SEM 

tcpkill -9 host $DEAD_HOST > $TKILL_ID_SEM 2>/dev/null &

KILL_PID=$!

CNT=0; CNTLIMIT=60

while [ $CNT -lt $CNTLIMIT ]; do

#    echo $TKILL_ID_SEM

    sleep 1

    test -f $TKILL_ID_SEM && rm -f $TKILL_ID_SEM && kill -9 $KILL_PID && exit 

    CNT = $[ $CNT + 1 ]

#    echo $CNT
done

kill -9 $KILL_PID
Bytes