Posted on January 23, 2017 by admin

Riavvio automatico Mac dopo un powerfail

Se avete un computer remoto, o uno al quale non potete accedere fisicamente e che deve rimanere sempre acceso, questo vi sarà molto utile. Ho visto online molti post dove sbattono solo la riga di comando da eseguire in terminale, senza spiegare e/o dire se è a prova di errori. Ecco come effettuare un riavvio automatico del vostro Mac dopo un powerfail.

Per questo hack utilizzeremo una chiavetta USB con una live di Ubuntu o altro sistema Linux.

Per prima cosa verificate che stiate facendo la cosa giusta ed agendo nel posto giusto.

Da terminale linux:
[code lang=”bash” gutter=”false”]
$ sudo lspci
[/code]

Vedrete la lista dei device pci.
Quello che interessa a noi è:
[code lang=”bash” gutter=”false”]
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
[/code]

Identificato ‘ISA bridge’ quello che ci interessa è l’id della periferica.
In questo caso ci serve 00:1f.0

[code lang=”bash” gutter=”false”]
sudo setpci -s 0:1f.0 0xa4.b=0
[/code]

Che cosa abbiamo fatto?
Con in comando setpci settiamo per il device 0:1f.0 il registro 0xa4 al valore 0.

Come indicato nelle specifiche:
0 = System will return to S0 state (boot) after power is re-applied.
1 = System will return to the S5 state (except if it was in S4, in which case it will return to S4). In the S5 state, the only enabled wake event is the Power Button or any enabled wake event that was preserved through the power failure.”

Alla prossima.