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

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

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