Shell Script: scripts pacakge for PC-Monitor on Ubuntu
PC_Monitor.sh
#!/bin/bash
echo -------------------------------------------
echo SCRIPT: "$(basename "$0")"
echo -------------------------------------------
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
###### MAIN ######
echo $BASEDIR
ping 127.0.0.1
uname -a > $BASEDIR/Log/ifconfig.log
date >> $BASEDIR/Log/ifconfig.log
ifconfig >> $BASEDIR/Log/ifconfig.log
exec_PC_Monitor.sh
#!/bin/bash
echo -------------------------------------------
echo SCRIPT: "$(basename "$0")"
echo -------------------------------------------
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
CALLSCRIPT=$BASEDIR/PC_Monitor.sh
LOGDIR=$BASEDIR/Autoit_Log
###### check Keyboard key:CapsLock ######
echo "[CHK] ...check Keyboard key:CapsLock"
$SikulixDIR/turnoff_key_CapsLock.sh
###### MAIN ######
echo "[TIME-START]" $(date)
mkdir $BASEDIR/Autoit_Log
## CAPTURE SCREEN
scrot -q 70 $BASEDIR/Autoit_Log/exec-screen.jpg
## CALL PROCESSNAME
echo "[CALL] ...>>> " $CALLSCRIPT
gnome-terminal --geometry=80x10+0+360 -x $BASEDIR/PC_Monitor.sh
## CAPTURE SCREEN DONE
scrot -q 70 $BASEDIR/Autoit_Log/exec-screen-done.jpg
# xterm -e $CALLSCRIPT
echo "[TIME-END]" $(date)
kill_PC_Monitor.sh
#!/bin/bash
echo -------------------------------------------
echo SCRIPT: "$(basename "$0")"
echo -------------------------------------------
BASEDIR=$(cd "$(dirname "$0")"; pwd -P) # for normal file
PROCESSNAME=PC_Monitor
SCREEN_Q=10
###### MAIN ######
echo "[TIME-START]" $(date)
## KILL PROCESSNAME
scrot -q $SCREEN_Q $BASEDIR/Autoit_Log/kill-screen01.jpg
ping -c 3 127.0.0.1
echo "[CALL] ...>>> kill process" $PROCESSNAME
kill -15 $(ps aux | grep $PROCESSNAME | grep -v grep | awk '{print $2}')
## KILL-DONE
ping -c 3 127.0.0.1
scrot -q $SCREEN_Q $BASEDIR/Autoit_Log/kill-screen-done.jpg
echo "[TIME-END]" $(date)
No comments:
Post a Comment