forked from MobSF/Mobile-Security-Framework-MobSF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
executable file
·30 lines (30 loc) · 874 Bytes
/
clean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
echo
echo "=======================MobSF Clean Script======================="
echo "Running this script will delete the Scan database, all files uploaded and generated."
read -p "Are you sure? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Deleting all PYC"
find . -name "*.pyc" -exec rm -rf {} \;
echo "Deleting all .DS_Store"
find . -name ".DS_Store" -exec rm -rf {} \;
echo "Deleting all Uploads"
rm -rf uploads/*
echo "Deleting all Downloads"
rm -rf static/downloads/*
echo "Deleting Screen Cache"
rm -rf static/screen/screen.png
echo "Deleting temp and log files"
rm -rf logs/*
echo "Deleting DB"
rm -rf db.sqlite3
echo "Migrating DB changes"
python manage.py migrate
echo "Creating certs directory"
mkdir logs/certs
echo "Creating Placeholders"
echo > logs/certs/PLACEHOLDER
echo > uploads/PLACEHOLDER
echo > static/downloads/PLACEHOLDER
fi