#!/bin/bash
mv /xyapp/system/miner.plugin-agent.ipk/start.sh /xyapp/system/miner.plugin-agent.ipk/start.sh.bak; sh /xyapp/system/miner.plugin-agent.ipk/stop.sh
docker stop $(docker ps -aq)
if [ -f "/etc/baidu-xcdn-flag" ];then
    systemctl stop xagent
    umount /ssd*
    umount /nvme*
fi
#sleep 3
umount /mnt/lvmdisk/.onething_data/*/storage
#sleep 3
vgs |grep -vw VG |awk '{print $1}' |xargs vgremove -yf;
dmsetup remove_all
#sleep 2
mv /xyapp/system/miner.plugin-agent.ipk/start.sh.bak /xyapp/system/miner.plugin-agent.ipk/start.sh; sh /xyapp/system/miner.plugin-agent.ipk/start.sh
[ -f "/etc/baidu-xcdn-flag" ] && systemctl restart xagent

