anydesk重启脚本
1.restart.sh:
#!/bin/sh sh /home/zhoushuo/anydeskTest/stop.sh echo 'zhoushuo'|sudo -S /usr/bin/anydesk
2.stop.sh:
#!/bin/sh NAME=anydesk echo $NAME ID=`ps -ef | grep "$NAME" | grep -v "grep" | awk '{print $2}'` echo $ID echo "---------------" for id in $ID do ./kill.sh $id echo "killed $id" done echo "---------------" echo "stop anydesk successfully!"
3.kill.sh:
#! /usr/bin/expect spawn sudo kill -9 [lindex $argv 0] send "zhoushuo\r" interact