mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
@@ -52,18 +52,51 @@ systemd 支持 CentOS,Ubuntu,Debian,Fedora...
|
|||||||
- Ftp debian无法安装成功。
|
- Ftp debian无法安装成功。
|
||||||
- php52,在debian无法安装成功。
|
- php52,在debian无法安装成功。
|
||||||
|
|
||||||
### 自动安装
|
|
||||||
|
### GW使用
|
||||||
|
|
||||||
|
- 自动安装
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
### 脚本更新
|
- 脚本更新
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### GN使用
|
||||||
|
|
||||||
|
- 自动安装
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install_cn.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
- 脚本更新
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update_cn.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### DEV使用
|
||||||
|
|
||||||
|
- 自动安装
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/install_dev.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
- 脚本更新
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/dev/scripts/update_dev.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### 无图不真相
|
### 无图不真相
|
||||||
|
|
||||||
[](/route/static/mdw.jpg)
|
[](/route/static/mdw.jpg)
|
||||||
@@ -82,7 +115,7 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Stargazers over time
|
### Stargazers over time
|
||||||
|
|
||||||
[](https://starchart.cc/midoks/mdserver-web)
|
[](https://starchart.cc/midoks/mdserver-web)
|
||||||
|
|
||||||
@@ -93,7 +126,7 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts
|
|||||||
|
|
||||||
[digitalvirt](https://digitalvirt.com/)
|
[digitalvirt](https://digitalvirt.com/)
|
||||||
|
|
||||||
## 授权许可
|
### 授权许可
|
||||||
|
|
||||||
本项目采用 Apache 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/midoks/mdserver-web/blob/master/LICENSE) 文件中。
|
本项目采用 Apache 开源授权许可证,完整的授权说明已放置在 [LICENSE](https://github.com/midoks/mdserver-web/blob/master/LICENSE) 文件中。
|
||||||
|
|
||||||
|
|||||||
@@ -12,5 +12,5 @@
|
|||||||
"author":"clean",
|
"author":"clean",
|
||||||
"home":"https://github.com/midoks",
|
"home":"https://github.com/midoks",
|
||||||
"date":"2021-11-23",
|
"date":"2021-11-23",
|
||||||
"pid": "4"
|
"pid": "5"
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# It's not recommended to modify this file in-place, because it
|
||||||
|
# will be overwritten during upgrades. If you want to customize,
|
||||||
|
# the best way is to use the "systemctl edit" command.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=The PHP {$VERSION} FastCGI Process Manager
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf
|
||||||
|
ExecStop=/bin/kill -INT $MAINPID
|
||||||
|
ExecReload=/bin/kill -USR2 $MAINPID
|
||||||
|
PrivateTmp=false
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -8,9 +8,9 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf
|
ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start
|
||||||
ExecStop=/bin/kill -INT $MAINPID
|
ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop
|
||||||
ExecReload=/bin/kill -USR2 $MAINPID
|
ExecReload={$SERVER_PATH}/php/init.d/php{$VERSION} reload
|
||||||
PrivateTmp=false
|
PrivateTmp=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Mr Chen
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,20 +0,0 @@
|
|||||||
<div class="bt-form">
|
|
||||||
<div class="bt-w-main">
|
|
||||||
<div class="bt-w-menu">
|
|
||||||
<p class="bgw" onclick="pluginService('socket5');">服务</p>
|
|
||||||
<p onclick="pluginInitD('socket5');">自启动</p>
|
|
||||||
<p onclick="pluginConfig('socket5',null, 'conf');">配置</p>
|
|
||||||
<p onclick="pluginConfig('socket5',null, 'conf_pwd');">用户</p>
|
|
||||||
<p onclick="pluginConfig('socket5',null, 'conf_port');">端口</p>
|
|
||||||
<p onclick="readme();">说明</p>
|
|
||||||
</div>
|
|
||||||
<div class="bt-w-con pd15">
|
|
||||||
<div class="soft-man-con"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$.getScript( "/plugins/file?name=socket5&f=js/socket5.js", function(){
|
|
||||||
pluginService('socket5');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,207 +0,0 @@
|
|||||||
# coding:utf-8
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import io
|
|
||||||
import os
|
|
||||||
import time
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
sys.path.append(os.getcwd() + "/class/core")
|
|
||||||
import mw
|
|
||||||
|
|
||||||
app_debug = False
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
app_debug = True
|
|
||||||
|
|
||||||
|
|
||||||
def getPluginName():
|
|
||||||
return 'socket5'
|
|
||||||
|
|
||||||
|
|
||||||
def getPluginDir():
|
|
||||||
return mw.getPluginDir() + '/' + getPluginName()
|
|
||||||
|
|
||||||
|
|
||||||
def getServerDir():
|
|
||||||
return mw.getServerDir() + '/' + getPluginName()
|
|
||||||
|
|
||||||
|
|
||||||
def getInitDFile():
|
|
||||||
if app_debug:
|
|
||||||
return '/tmp/' + getPluginName()
|
|
||||||
return '/etc/init.d/ss5'
|
|
||||||
|
|
||||||
|
|
||||||
def initDreplace():
|
|
||||||
return getPluginDir() + '/init.d/ss5'
|
|
||||||
|
|
||||||
|
|
||||||
def getArgs():
|
|
||||||
args = sys.argv[2:]
|
|
||||||
tmp = {}
|
|
||||||
args_len = len(args)
|
|
||||||
|
|
||||||
if args_len == 1:
|
|
||||||
t = args[0].strip('{').strip('}')
|
|
||||||
t = t.split(':')
|
|
||||||
tmp[t[0]] = t[1]
|
|
||||||
elif args_len > 1:
|
|
||||||
for i in range(len(args)):
|
|
||||||
t = args[i].split(':')
|
|
||||||
tmp[t[0]] = t[1]
|
|
||||||
|
|
||||||
return tmp
|
|
||||||
|
|
||||||
|
|
||||||
def checkArgs(data, ck=[]):
|
|
||||||
for i in range(len(ck)):
|
|
||||||
if not ck[i] in data:
|
|
||||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
|
||||||
return (True, mw.returnJson(True, 'ok'))
|
|
||||||
|
|
||||||
|
|
||||||
def status():
|
|
||||||
cmd = "ps -ef|grep ss5 |grep -v grep | grep -v python | awk '{print $2}'"
|
|
||||||
data = mw.execShell(cmd)
|
|
||||||
if data[0] == '':
|
|
||||||
return 'stop'
|
|
||||||
return 'start'
|
|
||||||
|
|
||||||
|
|
||||||
def initConf():
|
|
||||||
ss5_conf = getServerDir() + '/ss5.conf'
|
|
||||||
if not os.path.exists(ss5_conf):
|
|
||||||
tmp = getPluginDir() + '/tmp/ss5.conf'
|
|
||||||
if not os.path.exists(tmp):
|
|
||||||
mw.execShell('cp -rf ' + tmp + ' /etc/opt/ss5')
|
|
||||||
mw.execShell('cp -rf ' + tmp + ' ' + getServerDir())
|
|
||||||
|
|
||||||
init_file = '/etc/init.d/ss5'
|
|
||||||
if os.path.exists(init_file):
|
|
||||||
mw.execShell('chmod +x ' + init_file)
|
|
||||||
|
|
||||||
ss5_pwd = getServerDir() + '/ss5.passwd'
|
|
||||||
if not os.path.exists(ss5_pwd):
|
|
||||||
tmp = getPluginDir() + '/tmp/ss5.passwd'
|
|
||||||
|
|
||||||
if not os.path.exists(tmp):
|
|
||||||
mw.execShell('cp -rf ' + tmp + ' /etc/opt/ss5')
|
|
||||||
mw.execShell('cp -rf ' + tmp + ' ' + getServerDir())
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
|
||||||
initConf()
|
|
||||||
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
data = mw.execShell('service ss5 start')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
data = mw.execShell('service ss5 stop')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def restart():
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
data = mw.execShell('service ss5 restart')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def reload():
|
|
||||||
data = mw.execShell('service ss5 reload')
|
|
||||||
if data[1] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def getPathFile():
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return getServerDir() + '/ss5.conf'
|
|
||||||
return '/etc/opt/ss5/ss5.conf'
|
|
||||||
|
|
||||||
|
|
||||||
def getPathFilePwd():
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return getServerDir() + '/ss5.passwd'
|
|
||||||
return '/etc/opt/ss5/ss5.passwd'
|
|
||||||
|
|
||||||
|
|
||||||
def getPathFilePort():
|
|
||||||
return '/etc/sysconfig/ss5'
|
|
||||||
|
|
||||||
|
|
||||||
def initdStatus():
|
|
||||||
if not app_debug:
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
initd_bin = getInitDFile()
|
|
||||||
if os.path.exists(initd_bin):
|
|
||||||
return 'ok'
|
|
||||||
return 'fail'
|
|
||||||
|
|
||||||
|
|
||||||
def initdInstall():
|
|
||||||
import shutil
|
|
||||||
if not app_debug:
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
source_bin = initDreplace()
|
|
||||||
initd_bin = getInitDFile()
|
|
||||||
shutil.copyfile(source_bin, initd_bin)
|
|
||||||
mw.execShell('chmod +x ' + initd_bin)
|
|
||||||
mw.execShell('chkconfig --add ' + getPluginName())
|
|
||||||
return 'ok'
|
|
||||||
|
|
||||||
|
|
||||||
def initdUinstall():
|
|
||||||
if not app_debug:
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
mw.execShell('chkconfig --del ' + getPluginName())
|
|
||||||
initd_bin = getInitDFile()
|
|
||||||
os.remove(initd_bin)
|
|
||||||
return 'ok'
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
func = sys.argv[1]
|
|
||||||
if func == 'status':
|
|
||||||
print(status())
|
|
||||||
elif func == 'start':
|
|
||||||
print(start())
|
|
||||||
elif func == 'stop':
|
|
||||||
print(stop())
|
|
||||||
elif func == 'restart':
|
|
||||||
print(restart())
|
|
||||||
elif func == 'reload':
|
|
||||||
print(reload())
|
|
||||||
elif func == 'conf':
|
|
||||||
print(getPathFile())
|
|
||||||
elif func == 'conf_pwd':
|
|
||||||
print(getPathFilePwd())
|
|
||||||
elif func == 'conf_port':
|
|
||||||
print(getPathFilePort())
|
|
||||||
elif func == 'initd_status':
|
|
||||||
print(initdStatus())
|
|
||||||
elif func == 'initd_install':
|
|
||||||
print(initdInstall())
|
|
||||||
elif func == 'initd_uninstall':
|
|
||||||
print(initdUinstall())
|
|
||||||
else:
|
|
||||||
print('error')
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"title":"socket5",
|
|
||||||
"tip":"soft",
|
|
||||||
"name":"socket5",
|
|
||||||
"type":"运行环境",
|
|
||||||
"ps":"socket5",
|
|
||||||
"versions":"1.0",
|
|
||||||
"shell":"install.sh",
|
|
||||||
"checks":"server/socket5",
|
|
||||||
"author":"midoks",
|
|
||||||
"home":"https://github.com/teddysun/across/blob/master/socket5.sh",
|
|
||||||
"date":"2021-01-29",
|
|
||||||
"pid": "5"
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# chkconfig: 345 20 80
|
|
||||||
# description: This script takes care of starting \
|
|
||||||
# and stopping ss5
|
|
||||||
#
|
|
||||||
|
|
||||||
OS=`uname -s`
|
|
||||||
if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then
|
|
||||||
|
|
||||||
# Source function library.
|
|
||||||
. /etc/rc.d/init.d/functions
|
|
||||||
|
|
||||||
# Source networking configuration.
|
|
||||||
. /etc/sysconfig/network
|
|
||||||
|
|
||||||
# Check that networking is up.
|
|
||||||
[ ${NETWORKING} = "no" ] && exit 0
|
|
||||||
|
|
||||||
[ -f /usr/sbin/ss5 ] || exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Test custom variables
|
|
||||||
test -f /etc/sysconfig/ss5 && . /etc/sysconfig/ss5
|
|
||||||
|
|
||||||
# See how we were called.
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
# Start daemon.
|
|
||||||
echo -n "Starting ss5... "
|
|
||||||
if [ $OS = "Linux" ]; then
|
|
||||||
daemon /usr/sbin/ss5 -t $SS5_OPTS
|
|
||||||
touch /var/lock/subsys/ss5
|
|
||||||
else
|
|
||||||
if [ $OS = "SunOS" ]; then
|
|
||||||
/usr/sbin/ss5 -t
|
|
||||||
touch /var/lock/subsys/ss5
|
|
||||||
else
|
|
||||||
/usr/local/sbin/ss5 -t
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
echo "done"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
# Stop daemon.
|
|
||||||
echo "Shutting down ss5... "
|
|
||||||
if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then
|
|
||||||
killproc ss5
|
|
||||||
rm -f /var/lock/subsys/ss5
|
|
||||||
else
|
|
||||||
killall ss5
|
|
||||||
fi
|
|
||||||
rm -f /var/run/ss5/ss5.pid
|
|
||||||
echo "done"
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
# Reload configuration
|
|
||||||
if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then
|
|
||||||
echo -n "Reloading ss5... "
|
|
||||||
killproc ss5 -1
|
|
||||||
else
|
|
||||||
pkill -HUP ss5
|
|
||||||
fi
|
|
||||||
echo "done reload"
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
# Restart daemon
|
|
||||||
echo -n "Restarting ss5... "
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
if [ $OS = "Linux" ] || [ $OS = "SunOS" ]; then
|
|
||||||
status ss5
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ss5 {start|stop|status|restart|reload}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
#!/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/mw_install.pl
|
|
||||||
SYSOS=`uname`
|
|
||||||
|
|
||||||
Install_socket5()
|
|
||||||
{
|
|
||||||
yum -y install gcc automake make pam-devel openldap-devel cyrus-sasl-devel
|
|
||||||
|
|
||||||
isStart=""
|
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
|
||||||
mkdir -p $serverPath/source
|
|
||||||
mkdir -p $serverPath/socket5
|
|
||||||
|
|
||||||
if [ ! -f $serverPath/source/ss5-3.8.9-8.tar.gz ];then
|
|
||||||
wget -O $serverPath/source/ss5-3.8.9-8.tar.gz http://downloads.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
|
|
||||||
fi
|
|
||||||
echo '1.0' > $serverPath/socket5/version.pl
|
|
||||||
|
|
||||||
cd $serverPath/source && tar -xzvf ss5-3.8.9-8.tar.gz
|
|
||||||
cd $serverPath/source/ss5-3.8.9 && ./configure && make && make install
|
|
||||||
|
|
||||||
echo 'install complete' > $install_tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
Uninstall_socket5()
|
|
||||||
{
|
|
||||||
rm -rf $serverPath/socket5
|
|
||||||
rm -rf /usr/sbin/ss5
|
|
||||||
service ss5 stop
|
|
||||||
rm -rf /etc/init.d/ss5
|
|
||||||
echo "Uninstall completed" > $install_tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
action=$1
|
|
||||||
if [ "${1}" == 'install' ];then
|
|
||||||
Install_socket5
|
|
||||||
else
|
|
||||||
Uninstall_socket5
|
|
||||||
fi
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
function str2Obj(str){
|
|
||||||
var data = {};
|
|
||||||
kv = str.split('&');
|
|
||||||
for(i in kv){
|
|
||||||
v = kv[i].split('=');
|
|
||||||
data[v[0]] = v[1];
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
function lpPost(method,args,callback, title){
|
|
||||||
|
|
||||||
var _args = null;
|
|
||||||
if (typeof(args) == 'string'){
|
|
||||||
_args = JSON.stringify(str2Obj(args));
|
|
||||||
} else {
|
|
||||||
_args = JSON.stringify(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _title = '正在获取...';
|
|
||||||
if (typeof(title) != 'undefined'){
|
|
||||||
_title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 });
|
|
||||||
$.post('/plugins/run', {name:'l2tp', func:method, args:_args}, function(data) {
|
|
||||||
layer.close(loadT);
|
|
||||||
if (!data.status){
|
|
||||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof(callback) == 'function'){
|
|
||||||
callback(data);
|
|
||||||
}
|
|
||||||
},'json');
|
|
||||||
}
|
|
||||||
|
|
||||||
function lpAsyncPost(method,args){
|
|
||||||
var _args = null;
|
|
||||||
if (typeof(args) == 'string'){
|
|
||||||
_args = JSON.stringify(str2Obj(args));
|
|
||||||
} else {
|
|
||||||
_args = JSON.stringify(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
|
||||||
return syncPost('/plugins/run', {name:'l2tp', func:method, args:_args});
|
|
||||||
}
|
|
||||||
|
|
||||||
function readme(){
|
|
||||||
var readme = '<ul class="help-info-text c7">';
|
|
||||||
readme += '<li>默认需开放端口:UDP:1080</li>';
|
|
||||||
readme += '<li><a href="https://github.com/midoks/mdserver-web/wiki/%E6%8F%92%E4%BB%B6%E7%AE%A1%E7%90%86%5BSOCK5%5D">参考</a></li>';
|
|
||||||
readme += '</ul>';
|
|
||||||
$('.soft-man-con').html(readme);
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# 无用户配置
|
|
||||||
auth 0.0.0.0/0 - -
|
|
||||||
permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -
|
|
||||||
|
|
||||||
|
|
||||||
# 用户配置
|
|
||||||
#auth 0.0.0.0/0 - u
|
|
||||||
#permit - 0.0.0.0/0 - 0.0.0.0/0 - - - - -
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
test test
|
|
||||||
@@ -12,5 +12,5 @@
|
|||||||
"author":"midoks",
|
"author":"midoks",
|
||||||
"home":"",
|
"home":"",
|
||||||
"date":"2018-12-20",
|
"date":"2018-12-20",
|
||||||
"pid":"4"
|
"pid":"5"
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 439 B |
@@ -1,20 +0,0 @@
|
|||||||
<div class="bt-form">
|
|
||||||
<div class="bt-w-main">
|
|
||||||
<div class="bt-w-menu">
|
|
||||||
<p class="bgw" onclick="pluginService('v2ray');">服务</p>
|
|
||||||
<p onclick="pluginInitD('v2ray');">自启动</p>
|
|
||||||
<p onclick="pluginConfig('v2ray');">配置修改</p>
|
|
||||||
<p onclick="pluginLogs('v2ray','','run_log');">运行日志</p>
|
|
||||||
<p onclick="pluginLogs('v2ray','','error_log');">错误日志</p>
|
|
||||||
<p onclick="readme();">说明</p>
|
|
||||||
</div>
|
|
||||||
<div class="bt-w-con pd15">
|
|
||||||
<div class="soft-man-con"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$.getScript( "/plugins/file?name=v2ray&f=js/v2ray.js", function(){
|
|
||||||
pluginService('v2ray');
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
# coding:utf-8
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import io
|
|
||||||
import os
|
|
||||||
import time
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
sys.path.append(os.getcwd() + "/class/core")
|
|
||||||
import mw
|
|
||||||
|
|
||||||
app_debug = False
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
app_debug = True
|
|
||||||
|
|
||||||
|
|
||||||
def getPluginName():
|
|
||||||
return 'v2ray'
|
|
||||||
|
|
||||||
|
|
||||||
def getPluginDir():
|
|
||||||
return mw.getPluginDir() + '/' + getPluginName()
|
|
||||||
|
|
||||||
|
|
||||||
def getServerDir():
|
|
||||||
return mw.getServerDir() + '/' + getPluginName()
|
|
||||||
|
|
||||||
|
|
||||||
def getArgs():
|
|
||||||
args = sys.argv[2:]
|
|
||||||
tmp = {}
|
|
||||||
args_len = len(args)
|
|
||||||
|
|
||||||
if args_len == 1:
|
|
||||||
t = args[0].strip('{').strip('}')
|
|
||||||
t = t.split(':')
|
|
||||||
tmp[t[0]] = t[1]
|
|
||||||
elif args_len > 1:
|
|
||||||
for i in range(len(args)):
|
|
||||||
t = args[i].split(':')
|
|
||||||
tmp[t[0]] = t[1]
|
|
||||||
|
|
||||||
return tmp
|
|
||||||
|
|
||||||
|
|
||||||
def checkArgs(data, ck=[]):
|
|
||||||
for i in range(len(ck)):
|
|
||||||
if not ck[i] in data:
|
|
||||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
|
||||||
return (True, mw.returnJson(True, 'ok'))
|
|
||||||
|
|
||||||
|
|
||||||
def status():
|
|
||||||
cmd = "ps -ef|grep v2ray |grep -v grep | grep -v 'mdserver-web'| awk '{print $2}'"
|
|
||||||
data = mw.execShell(cmd)
|
|
||||||
if data[0] == '':
|
|
||||||
return 'stop'
|
|
||||||
return 'start'
|
|
||||||
|
|
||||||
|
|
||||||
def start():
|
|
||||||
|
|
||||||
shell_cmd = 'service ' + getPluginName() + ' start'
|
|
||||||
data = mw.execShell(shell_cmd)
|
|
||||||
|
|
||||||
if data[0] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def stop():
|
|
||||||
shell_cmd = 'service ' + getPluginName() + ' stop'
|
|
||||||
|
|
||||||
data = mw.execShell(shell_cmd)
|
|
||||||
if data[0] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def restart():
|
|
||||||
shell_cmd = 'service ' + getPluginName() + ' restart'
|
|
||||||
data = mw.execShell(shell_cmd)
|
|
||||||
|
|
||||||
log_file = getLog()
|
|
||||||
if os.path.exists(log_file):
|
|
||||||
clear_log_cmd = "echo '' > " + log_file
|
|
||||||
mw.execShell(clear_log_cmd)
|
|
||||||
|
|
||||||
if data[0] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def reload():
|
|
||||||
shell_cmd = 'service ' + getPluginName() + ' reload'
|
|
||||||
data = mw.execShell(shell_cmd)
|
|
||||||
if data[0] == '':
|
|
||||||
return 'ok'
|
|
||||||
return data[1]
|
|
||||||
|
|
||||||
|
|
||||||
def getPathFile():
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return getServerDir() + '/config.json'
|
|
||||||
return '/usr/local/etc/v2ray/config.json'
|
|
||||||
|
|
||||||
|
|
||||||
def getInitDFile():
|
|
||||||
if app_debug:
|
|
||||||
return '/tmp/' + getPluginName()
|
|
||||||
return '/etc/init.d/' + getPluginName()
|
|
||||||
|
|
||||||
|
|
||||||
def initdStatus():
|
|
||||||
shell_cmd = 'systemctl status v2ray.service | grep loaded | grep "enabled;"'
|
|
||||||
data = mw.execShell(shell_cmd)
|
|
||||||
if data[0] == '':
|
|
||||||
return 'fail'
|
|
||||||
return 'ok'
|
|
||||||
|
|
||||||
|
|
||||||
def initdInstall():
|
|
||||||
import shutil
|
|
||||||
if not app_debug:
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
mw.execShell('systemctl enable ' + getPluginName())
|
|
||||||
return 'ok'
|
|
||||||
|
|
||||||
|
|
||||||
def initdUinstall():
|
|
||||||
if not app_debug:
|
|
||||||
if mw.isAppleSystem():
|
|
||||||
return "Apple Computer does not support"
|
|
||||||
|
|
||||||
mw.execShell('systemctl disable ' + getPluginName())
|
|
||||||
return 'ok'
|
|
||||||
|
|
||||||
|
|
||||||
def getLog():
|
|
||||||
return '/var/log/v2ray/access.log'
|
|
||||||
|
|
||||||
|
|
||||||
def getErrLog():
|
|
||||||
return '/var/log/v2ray/error.log'
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
func = sys.argv[1]
|
|
||||||
if func == 'status':
|
|
||||||
print(status())
|
|
||||||
elif func == 'start':
|
|
||||||
print(start())
|
|
||||||
elif func == 'stop':
|
|
||||||
print(stop())
|
|
||||||
elif func == 'restart':
|
|
||||||
print(restart())
|
|
||||||
elif func == 'reload':
|
|
||||||
print(reload())
|
|
||||||
elif func == 'conf':
|
|
||||||
print(getPathFile())
|
|
||||||
elif func == 'initd_status':
|
|
||||||
print(initdStatus())
|
|
||||||
elif func == 'initd_install':
|
|
||||||
print(initdInstall())
|
|
||||||
elif func == 'initd_uninstall':
|
|
||||||
print(initdUinstall())
|
|
||||||
elif func == 'run_log':
|
|
||||||
print(getLog())
|
|
||||||
elif func == 'error_log':
|
|
||||||
print(getErrLog())
|
|
||||||
else:
|
|
||||||
print('error')
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"title":"v2ray",
|
|
||||||
"tip":"soft",
|
|
||||||
"name":"v2ray",
|
|
||||||
"type":"运行环境",
|
|
||||||
"ps":"v2ray",
|
|
||||||
"versions":"1.0",
|
|
||||||
"shell":"install.sh",
|
|
||||||
"checks":"server/v2ray",
|
|
||||||
"path": "server/v2ray",
|
|
||||||
"author":"midoks",
|
|
||||||
"home":"https://github.com/v2ray/v2ray-core",
|
|
||||||
"date":"2020-06-08",
|
|
||||||
"pid": "5"
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
# case1 https://toutyrater.github.io/advanced/wss_and_web.html
|
|
||||||
|
|
||||||
|
|
||||||
curPath=`pwd`
|
|
||||||
rootPath=$(dirname "$curPath")
|
|
||||||
rootPath=$(dirname "$rootPath")
|
|
||||||
serverPath=$(dirname "$rootPath")
|
|
||||||
|
|
||||||
|
|
||||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
|
||||||
|
|
||||||
SYSOS=`uname`
|
|
||||||
|
|
||||||
Install_v2ray()
|
|
||||||
{
|
|
||||||
isStart=""
|
|
||||||
echo '正在安装脚本文件...' > $install_tmp
|
|
||||||
mkdir -p $serverPath/v2ray
|
|
||||||
echo '1.0' > $serverPath/v2ray/version.pl
|
|
||||||
|
|
||||||
if [ "Darwin" == "$SYSOS" ];then
|
|
||||||
echo 'macosx unavailable' > $install_tmp
|
|
||||||
cat $curPath/tmp/v2ray.json > /usr/local/etc/v2ray/config.json
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
|
|
||||||
cat $curPath/tmp/v2ray.json > /usr/local/etc/v2ray/config.json
|
|
||||||
|
|
||||||
echo 'install complete' > $install_tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
Uninstall_v2ray()
|
|
||||||
{
|
|
||||||
rm -rf $serverPath/v2ray
|
|
||||||
echo "Uninstall completed" > $install_tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
action=$1
|
|
||||||
if [ "${1}" == 'install' ];then
|
|
||||||
Install_v2ray
|
|
||||||
else
|
|
||||||
Uninstall_v2ray
|
|
||||||
fi
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
function str2Obj(str){
|
|
||||||
var data = {};
|
|
||||||
kv = str.split('&');
|
|
||||||
for(i in kv){
|
|
||||||
v = kv[i].split('=');
|
|
||||||
data[v[0]] = v[1];
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
function lpPost(method,args,callback, title){
|
|
||||||
|
|
||||||
var _args = null;
|
|
||||||
if (typeof(args) == 'string'){
|
|
||||||
_args = JSON.stringify(str2Obj(args));
|
|
||||||
} else {
|
|
||||||
_args = JSON.stringify(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _title = '正在获取...';
|
|
||||||
if (typeof(title) != 'undefined'){
|
|
||||||
_title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
var loadT = layer.msg(_title, { icon: 16, time: 0, shade: 0.3 });
|
|
||||||
$.post('/plugins/run', {name:'shadowsocks', func:method, args:_args}, function(data) {
|
|
||||||
layer.close(loadT);
|
|
||||||
if (!data.status){
|
|
||||||
layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(typeof(callback) == 'function'){
|
|
||||||
callback(data);
|
|
||||||
}
|
|
||||||
},'json');
|
|
||||||
}
|
|
||||||
|
|
||||||
function lpAsyncPost(method,args){
|
|
||||||
var _args = null;
|
|
||||||
if (typeof(args) == 'string'){
|
|
||||||
_args = JSON.stringify(str2Obj(args));
|
|
||||||
} else {
|
|
||||||
_args = JSON.stringify(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
|
|
||||||
return syncPost('/plugins/run', {name:'l2tp', func:method, args:_args});
|
|
||||||
}
|
|
||||||
|
|
||||||
function userList(){
|
|
||||||
lpPost('user_list', '' ,function(data){
|
|
||||||
var rdata = $.parseJSON(data['data']);
|
|
||||||
|
|
||||||
if (!rdata['status']){
|
|
||||||
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var list = rdata['data'];
|
|
||||||
|
|
||||||
var con = '';
|
|
||||||
con += '<div class="divtable" style="margin-top:5px;"><table class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0">';
|
|
||||||
con += '<thead><tr>';
|
|
||||||
con += '<th>用户</th>';
|
|
||||||
con += '<th>密码</th>';
|
|
||||||
con += '<th>操作(<a class="btlink" onclick="addUser()">添加</a>)</th>';
|
|
||||||
con += '</tr></thead>';
|
|
||||||
|
|
||||||
con += '<tbody>';
|
|
||||||
|
|
||||||
for (var i = 0; i < list.length; i++) {
|
|
||||||
con += '<tr>'+
|
|
||||||
'<td>' + list[i]['user']+'</td>' +
|
|
||||||
'<td>' + list[i]['pwd']+'</td>' +
|
|
||||||
'<td><a class="btlink" onclick="modUser(\''+list[i]['user']+'\')">改密</a>|<a class="btlink" onclick="delUser(\''+list[i]['user']+'\')">删除</a></td></tr>';
|
|
||||||
}
|
|
||||||
|
|
||||||
con += '</tbody>';
|
|
||||||
con += '</table></div>';
|
|
||||||
|
|
||||||
$(".soft-man-con").html(con);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function readme(){
|
|
||||||
var readme = '<ul class="help-info-text c7">';
|
|
||||||
readme += '<li>需开放配置文件[port_password]端口</li>';
|
|
||||||
readme += '</ul>';
|
|
||||||
$('.soft-man-con').html(readme);
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
{
|
|
||||||
"log" : {
|
|
||||||
"access" : "/var/log/v2ray/access.log",
|
|
||||||
"error" : "/var/log/v2ray/error.log",
|
|
||||||
"loglevel":"warning"
|
|
||||||
},
|
|
||||||
"inbounds": [{
|
|
||||||
"port": 34861,
|
|
||||||
"listen": "127.0.0.1",
|
|
||||||
"protocol": "vmess",
|
|
||||||
"settings": {
|
|
||||||
"clients": [
|
|
||||||
{
|
|
||||||
"id": "6e1e5234-05ee-45fe-b28d-80e91edb7f30",
|
|
||||||
"alterId": 64
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"streamSettings":{
|
|
||||||
"network": "ws",
|
|
||||||
"wsSettings": {
|
|
||||||
"path": "/ws"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
"outbounds": [{
|
|
||||||
"protocol": "freedom",
|
|
||||||
"settings": {}
|
|
||||||
},{
|
|
||||||
"protocol": "blackhole",
|
|
||||||
"settings": {},
|
|
||||||
"tag": "blocked"
|
|
||||||
}],
|
|
||||||
"routing": {
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"type": "field",
|
|
||||||
"ip": ["geoip:private"],
|
|
||||||
"outboundTag": "blocked"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"inboundDetour": [
|
|
||||||
{
|
|
||||||
"protocol": "shadowsocks",
|
|
||||||
"port": 30008,
|
|
||||||
"settings": {
|
|
||||||
"method": "aes-128-gcm",
|
|
||||||
"password": "123123123",
|
|
||||||
"udp": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -32,22 +32,45 @@ if [ ${_os} == "Darwin" ]; then
|
|||||||
OSNAME='macos'
|
OSNAME='macos'
|
||||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
OSNAME='centos'
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
OSNAME='fedora'
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
OSNAME='rocky'
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
OSNAME='alma'
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
OSNAME='debian'
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
OSNAME='ubuntu'
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
OSNAME='raspbian'
|
OSNAME='raspbian'
|
||||||
else
|
else
|
||||||
OSNAME='unknow'
|
OSNAME='unknow'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ $OSNAME != "macos" ];then
|
||||||
|
mkdir -p /www/server
|
||||||
|
mkdir -p /www/wwwroot
|
||||||
|
mkdir -p /www/wwwlogs
|
||||||
|
mkdir -p /www/backup/database
|
||||||
|
mkdir -p /www/backup/site
|
||||||
|
|
||||||
|
if [ ! -d /www/server/mdserver-web ];then
|
||||||
|
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
||||||
|
cd /tmp && unzip /tmp/master.zip
|
||||||
|
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/master.zip
|
||||||
|
rm -rf /tmp/mdserver-web-master
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo "use system version: ${OSNAME}"
|
echo "use system version: ${OSNAME}"
|
||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/install/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|||||||
export PATH
|
export PATH
|
||||||
LANG=C.UTF-8
|
LANG=C.UTF-8
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||||
@@ -38,7 +33,7 @@ if [ -f /etc/init.d/iptables ];then
|
|||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
iptables_status=`service iptables status | grep 'not running'`
|
iptables_status=`service iptables status | grep 'not running'`
|
||||||
@@ -62,7 +57,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||||
|
|||||||
+17
-31
@@ -3,13 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||||
yum -y provides '*/applydeltarpm'
|
yum -y provides '*/applydeltarpm'
|
||||||
yum -y install deltarpm
|
yum -y install deltarpm
|
||||||
@@ -23,9 +16,9 @@ yum install -y wget lsof crontabs
|
|||||||
yum install -y python3-devel
|
yum install -y python3-devel
|
||||||
yum install -y python-devel
|
yum install -y python-devel
|
||||||
yum install -y vixie-cron
|
yum install -y vixie-cron
|
||||||
|
yum install -y curl-devel libmcrypt libmcrypt-devel
|
||||||
|
|
||||||
#https need
|
#https need
|
||||||
|
|
||||||
if [ ! -d /root/.acme.sh ];then
|
if [ ! -d /root/.acme.sh ];then
|
||||||
curl https://get.acme.sh | sh
|
curl https://get.acme.sh | sh
|
||||||
fi
|
fi
|
||||||
@@ -38,7 +31,7 @@ if [ -f /etc/init.d/iptables ];then
|
|||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
iptables_status=`service iptables status | grep 'not running'`
|
iptables_status=`service iptables status | grep 'not running'`
|
||||||
@@ -62,7 +55,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||||
@@ -76,27 +69,13 @@ systemctl stop firewalld
|
|||||||
yum groupinstall -y "Development Tools"
|
yum groupinstall -y "Development Tools"
|
||||||
|
|
||||||
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel
|
yum install -y libevent libevent-devel libjpeg* libpng* gd* libxslt* unzip libmcrypt libmcrypt-devel
|
||||||
yum install -y wget python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev libjpeg-devel libpng-devel libwebp libwebp-devel pcre pcre-devel
|
yum install -y python-imaging libicu-devel zip bzip2-devel gcc libxml2 libxml2-dev pcre pcre-devel
|
||||||
|
yum install -y libjpeg-devel libpng-devel libwebp libwebp-devel
|
||||||
yum install -y lsof net-tools
|
yum install -y lsof net-tools
|
||||||
yum install -y ncurses-devel mysql-devel cmake
|
yum install -y ncurses-devel mysql-devel cmake
|
||||||
yum install -y MySQL-python
|
yum install -y MySQL-python
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
|
|
||||||
if [ ! -d /www/server/mdserver-web ];then
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if [ ! -f '/usr/bin/pip' ];then
|
|
||||||
# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
|
||||||
# python get-pip.py
|
|
||||||
# pip install --upgrade pip
|
|
||||||
# pip install pillow==6.2.2
|
|
||||||
#fi
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/local/bin/pip3 ];then
|
if [ ! -f /usr/local/bin/pip3 ];then
|
||||||
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
python3 -m pip install --upgrade pip setuptools wheel -i https://mirrors.aliyun.com/pypi/simple
|
||||||
@@ -113,10 +92,6 @@ fi
|
|||||||
|
|
||||||
if [ -f /www/server/mdserver-web/bin/activate ];then
|
if [ -f /www/server/mdserver-web/bin/activate ];then
|
||||||
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate && pip3 install -r /www/server/mdserver-web/requirements.txt
|
||||||
else
|
|
||||||
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip3 install gunicorn==20.1.0
|
pip3 install gunicorn==20.1.0
|
||||||
pip3 install gevent==21.1.2
|
pip3 install gevent==21.1.2
|
||||||
@@ -126,7 +101,18 @@ pip3 install flask-caching==1.10.1
|
|||||||
pip3 install python-socketio==4.2.0
|
pip3 install python-socketio==4.2.0
|
||||||
pip3 install psutil==5.9.1
|
pip3 install psutil==5.9.1
|
||||||
pip3 install pymongo
|
pip3 install pymongo
|
||||||
|
else
|
||||||
|
pip install --upgrade pip
|
||||||
|
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt
|
||||||
|
pip3 install gunicorn==20.1.0
|
||||||
|
pip3 install gevent==21.1.2
|
||||||
|
pip3 install gevent-websocket==0.10.1
|
||||||
|
pip3 install requests==2.20.0
|
||||||
|
pip3 install flask-caching==1.10.1
|
||||||
|
pip3 install python-socketio==4.2.0
|
||||||
|
pip3 install psutil==5.9.1
|
||||||
|
pip3 install pymongo
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web && ./cli.sh start
|
cd /www/server/mdserver-web && ./cli.sh start
|
||||||
|
|||||||
@@ -4,12 +4,6 @@ export PATH
|
|||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
apt update -y
|
apt update -y
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +25,7 @@ if [ -f /usr/sbin/ufw ];then
|
|||||||
ufw allow 888/tcp
|
ufw allow 888/tcp
|
||||||
ufw allow 7200/tcp
|
ufw allow 7200/tcp
|
||||||
ufw allow 3306/tcp
|
ufw allow 3306/tcp
|
||||||
ufw allow 30000:40000/tcp
|
# ufw allow 30000:40000/tcp
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -53,7 +47,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
# fix:debian10 firewalld faq
|
# fix:debian10 firewalld faq
|
||||||
# https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8
|
# https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8
|
||||||
@@ -66,15 +60,6 @@ fi
|
|||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
|
|
||||||
if [ ! -d /www/server/mdserver-web ];then
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||||
yum -y provides '*/applydeltarpm'
|
yum -y provides '*/applydeltarpm'
|
||||||
@@ -36,7 +30,7 @@ if [ -f /etc/init.d/iptables ];then
|
|||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
iptables_status=`service iptables status | grep 'not running'`
|
iptables_status=`service iptables status | grep 'not running'`
|
||||||
@@ -62,7 +56,7 @@ if [ "${isVersion}" == '' ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -82,15 +76,7 @@ yum -y install ncurses-devel mysql-devel cmake
|
|||||||
yum -y install python-devel
|
yum -y install python-devel
|
||||||
yum -y install MySQL-python
|
yum -y install MySQL-python
|
||||||
yum -y install epel-release
|
yum -y install epel-release
|
||||||
yum -y install python36-devel
|
yum -y install python3-devel
|
||||||
|
|
||||||
if [ ! -d /www/server/mdserver-web ];then
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
|||||||
export PATH
|
export PATH
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
|
|
||||||
if [ ! -f /usr/bin/applydeltarpm ];then
|
if [ ! -f /usr/bin/applydeltarpm ];then
|
||||||
yum -y provides '*/applydeltarpm'
|
yum -y provides '*/applydeltarpm'
|
||||||
@@ -38,7 +32,7 @@ if [ -f /etc/init.d/iptables ];then
|
|||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 888 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 7200 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
|
||||||
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 30000:40000 -j ACCEPT
|
||||||
service iptables save
|
service iptables save
|
||||||
|
|
||||||
iptables_status=`service iptables status | grep 'not running'`
|
iptables_status=`service iptables status | grep 'not running'`
|
||||||
@@ -62,7 +56,7 @@ if [ ! -f /etc/init.d/iptables ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
|
|
||||||
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
|
||||||
@@ -82,14 +76,6 @@ yum install -y ncurses-devel mysql-devel cmake
|
|||||||
yum install -y MySQL-python
|
yum install -y MySQL-python
|
||||||
yum install -y epel-release
|
yum install -y epel-release
|
||||||
|
|
||||||
if [ ! -d /www/server/mdserver-web ];then
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
fi
|
|
||||||
|
|
||||||
#if [ ! -f '/usr/bin/pip' ];then
|
#if [ ! -f '/usr/bin/pip' ];then
|
||||||
# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
|
||||||
# python get-pip.py
|
# python get-pip.py
|
||||||
|
|||||||
@@ -4,13 +4,6 @@ export PATH
|
|||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /www/server
|
|
||||||
mkdir -p /www/wwwroot
|
|
||||||
mkdir -p /www/wwwlogs
|
|
||||||
mkdir -p /www/backup/database
|
|
||||||
mkdir -p /www/backup/site
|
|
||||||
|
|
||||||
apt update -y
|
apt update -y
|
||||||
|
|
||||||
apt install -y wget curl lsof unzip
|
apt install -y wget curl lsof unzip
|
||||||
@@ -32,7 +25,7 @@ if [ -f /usr/sbin/ufw ];then
|
|||||||
ufw allow 888/tcp
|
ufw allow 888/tcp
|
||||||
ufw allow 7200/tcp
|
ufw allow 7200/tcp
|
||||||
ufw allow 3306/tcp
|
ufw allow 3306/tcp
|
||||||
ufw allow 30000:40000/tcp
|
# ufw allow 30000:40000/tcp
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -52,7 +45,7 @@ if [ ! -f /usr/sbin/ufw ];then
|
|||||||
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
firewall-cmd --permanent --zone=public --add-port=888/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
firewall-cmd --permanent --zone=public --add-port=7200/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
firewall-cmd --permanent --zone=public --add-port=3306/tcp
|
||||||
firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
|
||||||
|
|
||||||
# fix:debian10 firewalld faq
|
# fix:debian10 firewalld faq
|
||||||
# https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8
|
# https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled/fang-huo-qiang#debian-10-firewalld-0.6.3-error-commandfailed-usrsbinip6tablesrestorewn-failed-ip6tablesrestore-v1.8
|
||||||
@@ -64,14 +57,6 @@ fi
|
|||||||
#安装时不开启
|
#安装时不开启
|
||||||
systemctl stop firewalld
|
systemctl stop firewalld
|
||||||
|
|
||||||
if [ ! -d /www/server/mdserver-web ];then
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|||||||
Executable
+80
@@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
|
export PATH
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
|
if [ -f /etc/motd ];then
|
||||||
|
echo "welcome to mdserver-web panel" > /etc/motd
|
||||||
|
fi
|
||||||
|
|
||||||
|
startTime=`date +%s`
|
||||||
|
|
||||||
|
_os=`uname`
|
||||||
|
echo "use system: ${_os}"
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
ln -sf /bin/bash /bin/sh
|
||||||
|
#sudo dpkg-reconfigure dash
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
ln -sf /bin/bash /bin/sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ ${_os} == "Darwin" ]; then
|
||||||
|
OSNAME='macos'
|
||||||
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
|
OSNAME='raspbian'
|
||||||
|
else
|
||||||
|
OSNAME='unknow'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ $OSNAME != "macos" ];then
|
||||||
|
mkdir -p /www/server
|
||||||
|
mkdir -p /www/wwwroot
|
||||||
|
mkdir -p /www/wwwlogs
|
||||||
|
mkdir -p /www/backup/database
|
||||||
|
mkdir -p /www/backup/site
|
||||||
|
|
||||||
|
if [ ! -d /www/server/mdserver-web ];then
|
||||||
|
wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||||
|
cd /tmp && unzip /tmp/master.zip
|
||||||
|
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/master.zip
|
||||||
|
rm -rf /tmp/mdserver-web-master
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "use system version: ${OSNAME}"
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
|
||||||
|
endTime=`date +%s`
|
||||||
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
Executable
+80
@@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
|
export PATH
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
|
if [ -f /etc/motd ];then
|
||||||
|
echo "welcome to mdserver-web panel" > /etc/motd
|
||||||
|
fi
|
||||||
|
|
||||||
|
startTime=`date +%s`
|
||||||
|
|
||||||
|
_os=`uname`
|
||||||
|
echo "use system: ${_os}"
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "Please run as root!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
ln -sf /bin/bash /bin/sh
|
||||||
|
#sudo dpkg-reconfigure dash
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
ln -sf /bin/bash /bin/sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ ${_os} == "Darwin" ]; then
|
||||||
|
OSNAME='macos'
|
||||||
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
|
OSNAME='raspbian'
|
||||||
|
else
|
||||||
|
OSNAME='unknow'
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ $OSNAME != "macos" ];then
|
||||||
|
mkdir -p /www/server
|
||||||
|
mkdir -p /www/wwwroot
|
||||||
|
mkdir -p /www/wwwlogs
|
||||||
|
mkdir -p /www/backup/database
|
||||||
|
mkdir -p /www/backup/site
|
||||||
|
|
||||||
|
if [ ! -d /www/server/mdserver-web ];then
|
||||||
|
wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||||
|
cd /tmp && unzip /tmp/dev.zip
|
||||||
|
mv /tmp/mdserver-web-dev /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/dev.zip
|
||||||
|
rm -rf /tmp/mdserver-web-dev
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "use system version: ${OSNAME}"
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/install/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
|
||||||
|
endTime=`date +%s`
|
||||||
|
((outTime=(${endTime}-${startTime})/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
@@ -22,22 +22,34 @@ if [ ${_os} == "Darwin" ]; then
|
|||||||
OSNAME='macos'
|
OSNAME='macos'
|
||||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
OSNAME='centos'
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
OSNAME='fedora'
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
OSNAME='rocky'
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
OSNAME='alma'
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
OSNAME='debian'
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
OSNAME='ubuntu'
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
OSNAME='raspbian'
|
OSNAME='raspbian'
|
||||||
else
|
else
|
||||||
OSNAME='unknow'
|
OSNAME='unknow'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
||||||
|
cd /tmp && unzip /tmp/master.zip
|
||||||
|
/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/master.zip
|
||||||
|
rm -rf /tmp/mdserver-web-master
|
||||||
|
|
||||||
#pip uninstall public
|
#pip uninstall public
|
||||||
echo "use system version: ${OSNAME}"
|
echo "use system version: ${OSNAME}"
|
||||||
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update/${OSNAME}.sh | bash
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update/${OSNAME}.sh | bash
|
||||||
|
|||||||
@@ -10,14 +10,8 @@ fi
|
|||||||
|
|
||||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||||
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
|
|
||||||
|
yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel
|
||||||
yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|||||||
@@ -10,14 +10,9 @@ fi
|
|||||||
|
|
||||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||||
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
|
|
||||||
|
yum install -y curl-devel libmcrypt libmcrypt-devel python3-devel
|
||||||
|
|
||||||
yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|||||||
@@ -5,13 +5,6 @@ LANG=en_US.UTF-8
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|||||||
@@ -10,11 +10,6 @@ fi
|
|||||||
|
|
||||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||||
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
/usr/bin/cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
|
|
||||||
|
|
||||||
yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel
|
yum install -y curl-devel libmcrypt libmcrypt-devel python36-devel
|
||||||
|
|||||||
@@ -4,13 +4,6 @@ export PATH
|
|||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
|
|
||||||
|
|
||||||
wget -O /tmp/master.zip https://codeload.github.com/midoks/mdserver-web/zip/master
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
cd /tmp && unzip /tmp/master.zip
|
|
||||||
cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
|
||||||
rm -rf /tmp/master.zip
|
|
||||||
rm -rf /tmp/mdserver-web-master
|
|
||||||
|
|
||||||
|
|
||||||
cd /www/server/mdserver-web/scripts && bash lib.sh
|
cd /www/server/mdserver-web/scripts && bash lib.sh
|
||||||
chmod 755 /www/server/mdserver-web/data
|
chmod 755 /www/server/mdserver-web/data
|
||||||
|
|||||||
Executable
+59
@@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
|
export PATH
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
|
startTime=`date +%s`
|
||||||
|
|
||||||
|
_os=`uname`
|
||||||
|
echo "use system: ${_os}"
|
||||||
|
|
||||||
|
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
sudo ln -sf /bin/bash /bin/sh
|
||||||
|
#sudo dpkg-reconfigure dash
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
sudo ln -sf /bin/bash /bin/sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${_os} == "Darwin" ]; then
|
||||||
|
OSNAME='macos'
|
||||||
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
|
OSNAME='raspbian'
|
||||||
|
else
|
||||||
|
OSNAME='unknow'
|
||||||
|
fi
|
||||||
|
|
||||||
|
wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||||
|
cd /tmp && unzip /tmp/master.zip
|
||||||
|
mv /tmp/mdserver-web-master /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/master.zip
|
||||||
|
rm -rf /tmp/mdserver-web-master
|
||||||
|
|
||||||
|
#pip uninstall public
|
||||||
|
echo "use system version: ${OSNAME}"
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
endTime=`date +%s`
|
||||||
|
((outTime=($endTime-$startTime)/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
Executable
+59
@@ -0,0 +1,59 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
|
export PATH
|
||||||
|
LANG=en_US.UTF-8
|
||||||
|
is64bit=`getconf LONG_BIT`
|
||||||
|
|
||||||
|
startTime=`date +%s`
|
||||||
|
|
||||||
|
_os=`uname`
|
||||||
|
echo "use system: ${_os}"
|
||||||
|
|
||||||
|
if grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
sudo ln -sf /bin/bash /bin/sh
|
||||||
|
#sudo dpkg-reconfigure dash
|
||||||
|
fi
|
||||||
|
|
||||||
|
if grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
sudo ln -sf /bin/bash /bin/sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${_os} == "Darwin" ]; then
|
||||||
|
OSNAME='macos'
|
||||||
|
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||||
|
OSNAME='centos'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||||
|
OSNAME='fedora'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||||
|
OSNAME='rocky'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||||
|
OSNAME='alma'
|
||||||
|
yum install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||||
|
OSNAME='debian'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||||
|
OSNAME='ubuntu'
|
||||||
|
apt install -y wget zip unzip
|
||||||
|
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||||
|
OSNAME='raspbian'
|
||||||
|
else
|
||||||
|
OSNAME='unknow'
|
||||||
|
fi
|
||||||
|
|
||||||
|
wget -O /tmp/dev.zip https://github.com/midoks/mdserver-web/archive/refs/heads/dev.zip
|
||||||
|
cd /tmp && unzip /tmp/dev.zip
|
||||||
|
mv /tmp/mdserver-web-dev /www/server/mdserver-web
|
||||||
|
rm -rf /tmp/dev.zip
|
||||||
|
rm -rf /tmp/mdserver-web-dev
|
||||||
|
|
||||||
|
#pip uninstall public
|
||||||
|
echo "use system version: ${OSNAME}"
|
||||||
|
curl -fsSL https://gitee.com/midoks/mdserver-web/raw/master/scripts/update/${OSNAME}.sh | bash
|
||||||
|
|
||||||
|
endTime=`date +%s`
|
||||||
|
((outTime=($endTime-$startTime)/60))
|
||||||
|
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||||
Reference in New Issue
Block a user