#!/usr/bin/bash # check whether sudo is invoked by the GUI or not SUDO=$(ps waxl | grep 'sudo -A /usr/lib/cryptobone/cbcontrol'| head -1) CBPID=$(echo $SUDO | cut -f4 -d' ') ps wax | grep $CBPID | grep /bin/cryptobone > /dev/null if [ $? -ne 0 ] then #echo YOU ARE NOT CRYPTOBONE exit 2 fi #-----------------------------------------------#