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

 

posted @ 2017-04-24 17:57  倚天剑雨  阅读(656)  评论(0编辑  收藏  举报