iOS/iPad scheduled reboot

mattriley
New Contributor II

I would like to know exactly what pieces I need to schedule nightly reboots of an iPad. It's used as a kiosk and restarting it would help keep it fresh for the next day, since the only times it has a problem rebooting fixes it.

I'm new to jamf. I have the iPad enrolled in jamf NOW. So that's working. I see a couple of discussions like this one but it's not clear to me what is needed in order to run a script similar to what is referenced in the disussion.

https://www.jamf.com/jamf-nation/discussions/30751/api-script-for-ipad-restart

Is jamf Pro the missing ingredient for me? Or would I need additional software to get this setup. It's frustrating as heck that a simple reboot/shutdown scheduler isn't included from Apple and I'm hoping jamf will be my salvation from it.

Thanks!
Matt

3 REPLIES 3

Emmert
Valued Contributor

I'm not familiar with Jamf Now, but I don't think that's a built-in feature in Jamf Pro either. You could accomplish it using the API though; you'd need to write a script that ran on a nightly basis on one of your computers to sent out the API command.

RDowson
New Contributor III

API is your friend for this one!

mattriley
New Contributor II

OK. I've been trying and trying at this but I can't figure it out.

There are two pieces I know I'm missing and can't verify how to get the exact info I need. There's probably more, but here's what I have so far:
...

!/bin/bash

apiUser="myjamfusername"
apiPass='myjamfpassword'
deviceID="1"

data="<mobile_device_command><general><command>RestartDevice</command></general><mobile_devices><mobile_device><id>${deviceID}</id></mobile_device></mobile_devices></mobile_device_command>"

echo "Attempting to send a RestartDevice command to Mobile Device with ID: $deviceID"

curl -ksu "$apiUser:$apiPass" -H "Content-Type: text/xml" "https://xxxxxx.jamfcloud.com/JSSResource/mobiledevicecommands/command" -d $data -X POST

exit 0
...

I save this script, make it executable and then run it. But, I don't know where to find the device ID for my iPad (which is enrolled and I can see it on the dashboard when I login to app.jamfnow.com). And I don't know if I have the correct URL - I just pulled the start of it from the link it makes for open enrollment, which is the form you see above in the curl command.

So, how can I find the missing pieces? Device ID and API URL for my account? I feel like I'm close but I need some help to get over the hump.

Thanks!
Matt