918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Rev | Line | |
---|
[36a4dfd] | 1 | #!/bin/bash |
---|
| 2 | # Scirpt de ejemplo para apagar un ordenador |
---|
| 3 | # (puede usarse como base para el programa de apagado usado por OpenGNSys Admin). |
---|
| 4 | |
---|
| 5 | |
---|
[14ed3c9] | 6 | # Desmontar los sistemas de archivos y la caché local. |
---|
[36a4dfd] | 7 | echo "[10] Desmontar todos los sistemas de archivos." |
---|
| 8 | sync |
---|
| 9 | for (( i=1; i <= $(ogDiskToDev | wc -w); i++ )); do |
---|
| 10 | ogUnmountAll $i 2>/dev/null |
---|
| 11 | done |
---|
| 12 | echo "[50] Desmontar cache local." |
---|
[14ed3c9] | 13 | ogUnmountCache 2>/dev/null |
---|
[062b55a] | 14 | echo "[70] Apagando el equipo." |
---|
[14ed3c9] | 15 | # Estado correcto de Wake-On-Lan antes de apagar. |
---|
| 16 | ethtool -s $DEVICE wol g 2>/dev/null |
---|
| 17 | # Detectar Busybox. |
---|
| 18 | BUSYBOX=$(which busyboxOLD) |
---|
| 19 | BUSYBOX=${BUSYBOX:-"busybox"} |
---|
| 20 | (sleep 5 && $BUSYBOX poweroff) |
---|
[062b55a] | 21 | |
---|
[36a4dfd] | 22 | |
---|
Note: See
TracBrowser
for help on using the repository browser.