#!/bin/bash
if isi services -a isi_avscan_d | grep enabled; then
    touch /tmp/patch-avscan
    echo "disabling isi_avscan_d service"
    isi services -a isi_avscan_d disable
    sleep 10
    if pgrep isi_avscan_d; then
        echo "isi_avscan_d running, killing isi_avscan_d"
        pkill isi_avscan_d 
    fi
else
    rm -f /tmp/patch-avscan
fi

for svc in isi_webui isi_papi_d isi_object_d isi_api_d apache2
do
   svc_finder=$(isi services -a | grep -o $svc)
   if [ "$svc_finder" == "$svc" ]
   then
      isi services -a $svc disable
   fi
done



exit 0


