-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
132 lines (112 loc) · 2.68 KB
/
install
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
echo "Archon installer"
PYTHON="$(which python3)"
PIP="$(which pip3)"
APPCONFIG="config/app.yaml"
SAPPCONFIG="config/sample.app.yaml"
APICONFIG="config/api.yaml"
SAPICONFIG="config/sample.api.yaml"
SMTPCONFIG="config/smtp.yaml"
SSMTPCONFIG="config/sample.smtp.yaml"
SITESDIR="storage/sites"
DEVICESDIR="storage/devices"
RESOURCESDIR="storage/resources"
LOGSDIR="storage/logs"
ARCHONDIR="/opt/archon-server"
cd $ARCHONDIR
if [[ ! -x "$PYTHON" ]];
then
echo "Python 3 is required, exiting..."
exit 1
fi
VERSIONRAW="$($PYTHON -V)"
EMPT=""
CLEAN="${VERSIONRAW/Python /$EMPT}"
NUM="${CLEAN//./$EMPT}"
echo $NUM
if [[ "$NUM" -lt "3100" ]];
then
echo "Python 3.10.0 or newer is required"
exit 1
fi
if [[ ! -x "$PIP" ]];
then
echo "PIP 3 is required, exiting..."
exit 1
fi
if [[ -x "$PYTHON" ]] & [[ -x "$PIP" ]];
then
pip3 install pymongo
pip3 install pyyaml
pip3 install pyopenssl
pip3 install pyIsEmail
pip3 install psutil
pip3 install websocket
pip3 install websocket-client
pip3 install dnspython
pip3 install python-slugify
pip3 install asyncssh
pip3 install nest_asyncio
pip3 install requests
pip3 install uvicorn
pip3 install fastapi
pip3 install mysql-connector-python
pip3 install colorama
pip3 install jinja2
pip3 install pytz
if [[ ! -d $SITESDIR ]];
then
mkdir -p $SITESDIR
echo "Created directory $SITESDIR"
else
echo "Directory $SITESDIR exists"
fi
if [[ ! -d $DEVICESDIR ]];
then
mkdir -p $DEVICESDIR
echo "Created directory $DEVICESDIR"
else
echo "Directory $DEVICESDIR exists"
fi
if [[ ! -d $RESOURCESDIR ]];
then
mkdir -p $RESOURCESDIR
echo "Created directory $RESOURCESDIR"
else
echo "Directory $RESOURCESDIR exists"
fi
if [[ ! -d $LOGSDIR ]];
then
mkdir -p $LOGSDIR
echo "Created directory $LOGSDIR"
else
echo "Directory $LOGSDIR exists"
fi
if [[ ! -f $APPCONFIG ]];
then
cp $SAPPCONFIG $APPCONFIG
echo "Created file $APPCONFIG"
else
echo "File $APPCONFIG exists"
fi
if [[ ! -f $APICONFIG ]];
then
cp $SAPICONFIG $APICONFIG
echo "Created file $APICONFIG"
else
echo "File $APICONFIG exists"
fi
if [[ ! -f $SMTPCONFIG ]];
then
cp $SSMTPCONFIG $SMTPCONFIG
echo "Created file $SMTPCONFIG"
else
echo "File $SMTPCONFIG exists"
fi
if [[ ! -h "/usr/bin/arc" ]];
then
ln -s $ARCHONDIR/arc /usr/bin/arc
fi
cp -f $ARCHONDIR/archon-update.sh /opt/archon-update.sh
chmod +x arc server /opt/archon-update
fi