把# See if we need to cut the power.
if [ "$INIT_HALT" = "OWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
then
/etc/init.d/ups-monitor poweroff
fi
中[ "$INIT_HALT" = "OWEROFF" ] && [ -x /etc/init.d/ups-monitor ]]
改成:[ "$INIT_HALT" = "OWEROFF"-a -x /etc/init.d/ups-monitor ]
试试看。我比较了了一下你的脚本和我的脚本,他们唯一的区别在这里