-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
27 lines (22 loc) · 965 Bytes
/
main.py
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
from flask import Flask, render_template, request
import sys
import os
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
if request.form['submit_button'] == 'Run Full Scan':
os.system("notify-send 'SpiderClam' 'Starting Full ClamAV Scan'")
os.system("clamscan -r --quiet --bell --remove=yes /")
print('Running Full Scan')
return render_template('index.html')
elif request.form['submit_button'] == 'Run':
#os.system("notify-send 'SpiderClam' 'Fresh Clam has started an update'")
os.system('su -c "sudo freshclam --show-progress" spiderweb')
return render_template('index.html')
else:
pass # unknown
elif request.method == 'GET':
return render_template('index.html')
if "__name__" == "__main__":
app.run(debug=True, host='0.0.0.0', port=5000)