#!/usr/bin/sh
# Changes by NEC Corporation for the VE port, 2025
mode="$2"
node="$1"
case x"$mode" in
xonline)
systemctl is-enabled psacct-ve@${node} > /dev/null 2>&1
if [ $? -eq "0" ]
then
       systemctl restart psacct-ve@${node}.service
else
       systemctl list-units --state=active \
               | grep "psacct-ve@${node}.service" > /dev/null 2>&1
       if [ $? -eq "0" ]
       then
               systemctl stop psacct-ve@${node}.service
       fi
fi
;;
esac
exit 0

