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/l2tp/install.sh

47 lines
836 B

6 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
6 years ago
SYSOS=`uname`
6 years ago
6 years ago
Install_l2tp()
6 years ago
{
6 years ago
isStart=""
6 years ago
echo '正在安装脚本文件...' > $install_tmp
6 years ago
mkdir -p $serverPath/l2tp
echo '1.0' > $serverPath/l2tp/version.pl
6 years ago
6 years ago
cp -rf scripts/l2tp.sh $serverPath/l2tp
6 years ago
chmod +x $serverPath/l2tp/l2tp.sh
6 years ago
6 years ago
if [ "Darwin" == "$SYSOS" ];then
echo 'macosx unavailable' > $install_tmp
exit 0
fi
6 years ago
/bin/sh $serverPath/l2tp/l2tp.sh
6 years ago
6 years ago
echo 'install complete' > $install_tmp
6 years ago
}
6 years ago
Uninstall_l2tp()
6 years ago
{
6 years ago
rm -rf $serverPath/l2tp
6 years ago
echo "Uninstall completed" > $install_tmp
6 years ago
}
action=$1
if [ "${1}" == 'install' ];then
6 years ago
Install_l2tp
6 years ago
else
6 years ago
Uninstall_l2tp
6 years ago
fi