Files
Mobile-Security-Framework-M…/run.sh
Ajin Abraham 70e243d661 4.1.8 (#2448)
* APKID QA.
* Bash and Batch file script QA.
* Android Report template optimizations on how exported components are displayed.
* Clickable Android Activities, Services, Providers and Recievers.
* Updated Android version support to 11.0 for Android Studio AVD.
* Created helper scripts for AVDs `scripts/start_avd.sh` and `scripts/start_avd.ps1`.
2024-11-10 00:44:20 -08:00

36 lines
819 B
Bash
Executable File

#!/bin/bash
var="$1"
function validate_ip() {
local IP=$1
if [[ $IP =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
for i in ${IP//./ }; do
((i >= 0 && i <= 255)) || { echo 'Bad IP'; exit 1; }
done
else
echo 'Bad IP'
exit 1
fi
}
function validate_port() {
local PORT=$1
if [[ -z "$PORT" || "$PORT" -le 1024 || "$PORT" -ge 65535 ]]; then
echo 'Invalid Port'
exit 1
fi
}
if [[ -n "$var" ]]; then
IP="${var%%:*}"
PORT="${var##*:}"
validate_ip "$IP"
validate_port "$PORT"
else
IP='[::]'
PORT='8000'
fi
python3 -m poetry run gunicorn -b ${IP}:${PORT} mobsf.MobSF.wsgi:application --workers=1 --threads=10 --timeout=3600 \
--log-level=critical --log-file=- --access-logfile=- --error-logfile=- --capture-output