#!/bin/bash
MYTH_RUN_STATUS="1"
. /etc/profile
INIT=`ps -p 1 -o comm=`

#ignore -d option
if [ x$1 = x-d ]
then
    exit 0
fi

if [ x$INIT = xrunit ]
then
    shutdown -h
else
    systemctl poweroff $@
fi