2012/07/19 (3) Thumbnail List 여러 장비에서 자동으로 슬립모드로 들어가는 bash shell script 한참 머리 굴리다가 만들었다. ㅋㅋ windows에 ssh 서버를 설치해야 하고, (cygwin으로 하면 편한듯)각 ssh서버들에 id_rsa.pub을 .ssh/authorized_key로 복사해 넣어야 하는 단점이 있긴 하지만... #!/bin/bash if [[ -z $1 ]]; then RUN_IN_SEC=30 else RUN_IN_SEC=$1 fi PC_ADDR=( "root@172.20.31.27,linux" "ikko@172.20.31.26,windows" "root@localhost,linux" ) # Remote PC function Run_Remote_Suspend() { local variables=( `echo $@ | tr "," " "` ) local id_address=${var.. 시스템 sleep 관련 event 발생시 자동실행 /etc/pm/sleep.d/ 에서 스크립트를 만들면 아래의 경우 자동으로 해당 스크립트를 실행해준다. hibernateresumethawsuspend 예제) #!/bin/bash PATH=/sbin:/usr/sbin:/bin:/usr/bin WAKEONLAN=/usr/bin/wakeonlan if [ ! -x $WAKEONLAN ]; then exit 0 fi case "${1}" in resume) wakeonlan 00:23:11:22:33:44 wakeonlan 00:24:11:22:33:44 ;; suspend|hibernate|thaw) # nothing ;; esac 일반적인 리눅스 bash command https://zignd.wordpress.com/2012/07/11/an-a-z-index-of-the-bash-command-line-for-linux/ Prev 1 Next