1 Star 1 Fork 2

个人收藏室/Mobile-Security-Framework-MobSF

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
run.sh 952 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
var="$1"
function validate_ip () {
local IP=$1
local stat=1
if [[ $IP =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($IP)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
if [ "$stat" -eq 0 ]; then
return $stat
else
echo 'Bad IP'
exit 1
fi
}
function validate_port () {
local PORT=$1
if [ -z "$PORT" ]; then
echo 'Port can not be empty'
exit 1
fi
if [ "$PORT" -gt 1024 ] && [ "$PORT" -lt 65535 ]; then
return 0
else
echo 'Invalid Port'
exit 1
fi
}
if [ ! -z "$var" ]; then
IP=$(echo $var | awk -F':' '{print $1}')
PORT=$(echo $var | awk -F':' '{print $2}')
validate_ip $IP
validate_port $PORT
else
IP='0.0.0.0'
PORT='8000'
fi
. venv/bin/activate && gunicorn -b ${IP}:${PORT} mobsf.MobSF.wsgi:application --workers=1 --threads=10 --timeout=3600
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/software-reverse-engineering/Mobile-Security-Framework-MobSF.git
git@gitee.com:software-reverse-engineering/Mobile-Security-Framework-MobSF.git
software-reverse-engineering
Mobile-Security-Framework-MobSF
Mobile-Security-Framework-MobSF
master

搜索帮助