pupkill 459 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. #(c) Copyright Barry Kauler sept 2011 bkhome.org
  3. #License GPL3 (/usr/share/doc/legal)
  4. #like kill but special code to kill /usr/bin/pupdialog dlgs.
  5. #PID is passed in.
  6. #see /usr/sbin/shutdownconfig for example of usage.
  7. [ ! $1 ] && exit
  8. ALLPS="`ps`"
  9. pdPID="`echo "$ALLPS" | grep "PUP${1}DLG" | cut -f 1 -d ' ' | tr '\n' ' '`" #get PID of pupdialog window.
  10. if [ "$pdPID" ];then
  11. kill $pdPID 2>/dev/null
  12. sleep 0.2
  13. fi
  14. kill $1 2>/dev/null
  15. ###END###