-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrun-PolGen.sh
More file actions
34 lines (29 loc) · 793 Bytes
/
run-PolGen.sh
File metadata and controls
34 lines (29 loc) · 793 Bytes
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
31
32
33
34
#!/bin/bash
set -e
if [ ! -d "env" ]; then
echo "Please run './PolGen-Installer.sh' first to set up the environment."
exit 1
fi
check_internet_connection() {
echo "Checking internet connection..."
if ping -c 1 google.com &> /dev/null; then
echo "Internet connection is available."
INTERNET_AVAILABLE=1
else
echo "No internet connection detected."
INTERNET_AVAILABLE=0
fi
echo
}
running_interface() {
echo "Running Interface..."
if [ "$INTERNET_AVAILABLE" -eq 1 ]; then
echo "Running app.py in ONLINE mode..."
"./env/bin/python" app.py --open
else
echo "Running app.py in OFFLINE mode..."
"./env/bin/python" app.py --offline --open
fi
}
check_internet_connection
running_interface