Add DHCP network boot management to API and UI
Enhance the dashboard API with new endpoints for managing DHCP network boot options, allowing devices to enable or disable network boot via POST requests. Update the device action handling to include a 'reboot' action, specifically for network devices. Modify the home.html template to display the current state of network boot and provide a button for disabling it. Update provisioning scripts to disable network boot after deployment or backup completion, ensuring devices boot from eMMC on the next startup. Improve user feedback and error handling throughout the changes.
This commit is contained in:
@@ -29,7 +29,8 @@ while true; do
|
||||
continue
|
||||
fi
|
||||
curl -sL "$url" | dd of="$EMMC_DEV" bs=4M status=progress conv=fsync
|
||||
echo "Deploy done. Reboot to run from eMMC."
|
||||
echo "Deploy done. Disabling network boot on server so device boots from eMMC next time."
|
||||
curl -s -X POST "$BASE_URL/api/action-done?mac=$MAC" || true
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -41,9 +42,15 @@ while true; do
|
||||
continue
|
||||
fi
|
||||
dd if="$EMMC_DEV" bs=4M status=progress 2>/dev/null | curl -s -X POST -T - "$upload_url"
|
||||
echo "Backup done."
|
||||
echo "Backup done. Disabling network boot on server."
|
||||
curl -s -X POST "$BASE_URL/api/action-done?mac=$MAC" || true
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$action" == "reboot" ]]; then
|
||||
echo "Boot normally: rebooting..."
|
||||
reboot -f 2>/dev/null || exec reboot 2>/dev/null || exit 0
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user