close
Warning:
Failed to sync with repository "ogBrowser-Git": (1366, "Incorrect string value: '\\xF0\\x9F\\x93\\xA6 I...' for column 'message' at row 1"); repository information may be out of date. Look in the Trac log for more information including mitigation strategies.
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
| Line | |
|---|
| 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 | |
|---|
| 6 | # Desmontar los sistemas de archivos y la caché local. |
|---|
| 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." |
|---|
| 13 | ogUnmountCache 2>/dev/null |
|---|
| 14 | echo "[70] Apagando el equipo." |
|---|
| 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 | |
|---|
| 21 | # Retardo para dar lugar al registro en cola de acciones. |
|---|
| 22 | sleep 5 |
|---|
| 23 | # Parar Browser para evitar "cuelgues". |
|---|
| 24 | pkill browser |
|---|
| 25 | # Apagar. |
|---|
| 26 | $BUSYBOX poweroff |
|---|
| 27 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.