/usr/bin or /usr/local/bin 에 실행권한 주고 넣어서 사용
# /bin/bash # pm COMMAND=$1 if [ -z "$COMMAND" ]; then echo "Please input [on/off/stat/show] at first variable"; else if [ "on" == "$COMMAND" ]; then sudo pmset -c disablesleep 0; elif [ "off" == "$COMMAND" ]; then sudo pmset -c disablesleep 1; elif [ "stat" == "$COMMAND" ]; then export SLEEP_STAT=`pmset -g | grep SleepDisabled | awk '{printf $2}'`; if [ "1" -eq "$SLEEP_STAT" ]; then echo "STATUS : sleep off"; else echo "STATUS : sleep on"; fi elif [ "show" == "$COMMAND" ]; then pmset -g else echo "Please input [on/off/stat/show] at first variable"; fi fi |
'OS > macOS' 카테고리의 다른 글
[OS/macOS] FATA[0000] networks.yaml: "/opt/socket_vmnet/bin/socket_vmnet" (`paths.socketVMNet`) has to be installed (0) | 2024.06.08 |
---|---|
[OS/macOS] 패킷 트레이스 명령어 (0) | 2022.07.07 |
[OS/macOS] macOS M1 Processor 환경에서 LIMA 를 이용한 oracle 설치 (0) | 2022.04.01 |
[OS/macOS] remote 서버 접근 ip 저장 script (vmgmt) (0) | 2021.06.18 |
[OS/macOS] numbers 숫자를 문자로 변경 (number to text) (0) | 2021.06.18 |