#!/bin/bash
#
# Helper script to gracefully power-down unRAID server.
# Works only if webGui is running and listening on port 80.

# Access a blank page in case this is first request since startup.
/usr/bin/wget -q -O - localhost/update.htm >/dev/null

# Have emhttp do all the work as if user clicked 'shutdown' in webGui.
/usr/bin/wget -q -O - localhost/update.htm?shutdown=apply >/dev/null
