#!/bin/ash # Running as root? touch "/run" || exit 2 ACTION=$1 if [ "x$ACTION" != "xresume" ] && [ "x$ACTION" != "xsuspend" ]; then echo "Expecting resume or suspend as argument!" >&2 exit 1 fi . /opt/openslx/config UUID=$(cat /etc/system-uuid) echo "Submitting to $SLX_REMOTE_LOG" if curl --retry 4 --retry-connrefused --data-urlencode "type=~$ACTION" --data-urlencode "uuid=$UUID" "$SLX_REMOTE_LOG" | grep -q "RESULT=0"; then echo "Success" exit 0 else echo "Failed..." fi echo "Giving up" >&2 exit 1