Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/task_manager/install.sh

50 lines
1.1 KiB

11 months ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
VERSION=$2
11 months ago
# python3 plugins/task_manager/task_manager_index.py
11 months ago
# /www/server/mdserver-web/bin/python3 /www/server/mdserver-web/plugins/task_manager/process_network_total.py
11 months ago
# ps -ef|grep process_network_total| grep -v grep | awk '{print $2}' | xargs kill -9
11 months ago
11 months ago
Install_App()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/task_manager
11 months ago
if [ -f /usr/bin/apt ]; then
11 months ago
apt install libpcap-dev -y
fi
11 months ago
if [ -f /usr/bin/yum ]; then
11 months ago
yum install libpcap-devel -y
fi
11 months ago
if [ -f /usr/bin/dnf ]; then
dnf install libpcap-devel -y
fi
11 months ago
echo "$VERSION" > $serverPath/task_manager/version.pl
echo "安装任务管理器成功"
}
Uninstall_App()
{
rm -rf $serverPath/task_manager
echo "卸载任务管理器成功"
}
action=$1
if [ "${1}" == 'install' ];then
Install_App
else
Uninstall_App
fi