#!/bin/sh
#!/bin/bash

rhostname=$(cat /etc/xyapp/hostname)
# 关闭本地控制台IP登录方式
if [ -e /root/.webconfig ];then
    inc=$(cat /root/.webconfig  | jq -r '.bind_nic')
    sed "s/${inc}/lo/g" -i /root/.webconfig
    /usr/local/xyvod/xyapp/system/miner.plugin-netd.ipk/stop.sh >/dev/null 2>&1 &
    /usr/local/xyvod/xyapp/system/miner.plugin-netd.ipk/start.sh >/dev/null 2>&1 &
    [ $(cat /root/.webconfig | grep -c lo) -eq 0 ] && echo -e "##Result-: $(echo $rhostname) : fail,关闭本地控制台IP登录方式失败.\n"
else
    echo "未安装控制台插件无需安装."
fi
