Pagina 1 van 1

Ipad initiates automated Wake On Lan when opening the lid.

Geplaatst: 27 aug 2019, 21:35
door gedeco
De titel zegt alles.

Ik ben op zoek naar een wake on lan app die mijn server wekt op het momennt dat je de Ipad activeert.
Voor andere OS (windows, linux) zie ik hier geen graten in, lijkt me eenvoudig, desnoods met een scriptje, maar IOS, daar ben ik onvoldoende mee vertrouwd.

Ik zoek geen app waarbij je moet klikken welke server je wekt, het moet automatisch transparant gebeuren

Is er iemand die me de juiste richting kan aangeven?

Geert

Re: Ipad initiates automated Wake On Lan when opening the lid.

Geplaatst: 28 aug 2019, 07:26
door selder
Zo'n functionaliteit zit niet in iOS, en ik betwijfel of je een ander mobiel OS gaat vinden waar je dit wel kan doen.

Voor WOL (en het omgekeerde) van m'n Windows machines thuis vanop iOS gebruik ik een (zelf ontwikkelde) shortcut, die via SSH een script uitvoert op m'n Synology NAS. Maar er is geen manier om die shortcut aan te roepen telkens je de iPad unlocked, die functionaliteit zit er gewoon niet in.

Ik was van plan om alles uit te schrijven in een Medium.com post maar dat is er nog niet van gekomen, ik heb mijn post vanop een ander forum hieronder schaamteloos gepaste. Heb ondertussen wel uitgevogeld hoe ik het synonet commando als gewone gebruiker kan uitvoeren, maar dan zou ik eens heel hard moeten zoeken hoe ik dat gedaan heb, ik denk m'n user toegevoegd in de sudoers file en synonet correct gechmod.

---

I didn't find any way to do this directly from a iOS Shortcut, so I'm using my Synology NAS as box to actually send the start or shutdown commands. My guess is that any other 2nd host running linux will also accept these commands.

Shutdown
You'll need to configure your Windows PC as following:
- The NetworkCategory needs to be Private (public doesn't work even if you disable the firewall as test)
- UAC prompt needs to be disabled
- "Windows Management Instrumentation" needs to be allowed through the Windows Firewall
- Remote Registry service needs to be enabled and started via services.msc
Create "Run Script Over SSH" and use the login information of your Synology NAS or 2nd host.
Use the following command in your iOS Shortcut:

Code: Selecteer alles

NET RPC SHUTDOWN -I 10.0.0.1 -U "user%password"
(Obviously change IP and the user%password to the information of your target Windows PC that you want to shut down)

Start
You'll need to configure your Windows PC as following:
- Enable WOL in your BIOS/UEFI
- Enable WOL on your ethernet adapter
- Disable Fast Startup of Windows 10 (at the "change what the powerbuttons do" screen)
I have only investigated how to do this via my Synology NAS running the latest version of DSM. An extra step here is that Synology does no longer allow the root or admin user to log in over SSH - and there is no option to re-enable it. Running the "synonet --wake" command requires root privileges, I haven't found a way to run this command as your normal user.
The following command parses the root password to the synonet command.
Please be aware that this is some trickery, I can't consider this command to be safe, your root password is exposed, so if your iPhone/iPad isn't secured this is a very big security risk for your Synology NAS.

Code: Selecteer alles

echo password1 | sudo -S /usr/syno/sbin/synonet --wake 00:00:00:00:00:00 eth1
password1 is the password of the root user on your Synology NAS, which is the same as the admin user.

Enjoy!