Skip to content

Commit 4084c34

Browse files
committed
add yum script 1
1 parent a8036aa commit 4084c34

5 files changed

+54
-14
lines changed

init_server.sh init_server_apt.sh

File renamed without changes.

init_server_yum.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python3
2+
cd `dirname $0`
3+
echo "installing dependencies..."
4+
yum install -y python3 python3-devel python3-pip epel-release lzo-devel lzo-minilzo zlib-devel libjpeg-turbo-devel
5+
pip3 install -r requirements1.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
6+
pip3 install -r requirements2.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
7+
file="db.sqlite3"
8+
if [ ! -f $file ]
9+
then
10+
echo "initializing db.sqlite3..."
11+
python3 manage.py makemigrations
12+
python3 manage.py migrate
13+
python3 manage.py makemigrations mdict
14+
python3 manage.py migrate mdict
15+
python3 manage.py makemigrations mynav
16+
python3 manage.py migrate mynav
17+
python3 manage.py createsuperuser
18+
else
19+
echo "db.sqlite3 already exists..."
20+
fi
21+
chmod 777 db.sqlite3
22+
cd mdict/readlib/pyx
23+
echo "cython compiling..."
24+
source build.sh
25+
cd ../../../

run_server.sh

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
file="mdict_path.json"
2-
if [ ! -f $file ]; then
3-
echo "set mdict path and audio path..."
4-
read -p "input mdict path: " mdict_path
5-
if [ $mdict_path ]; then
6-
python3 init_mdict_path.py -m $mdict_path
7-
fi
8-
read -p "input audio path: " audio_path
9-
if [ $audio_path ]; then
10-
python3 init_mdict_path.py -a $audio_path
11-
fi
12-
fi
13-
source init_server.sh
14-
python3 manage.py runserver 0.0.0.0:8000 --noreload
1+
source run_server_apt.sh

run_server_apt.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
file="mdict_path.json"
2+
if [ ! -f $file ]; then
3+
echo "set mdict path and audio path..."
4+
read -p "input mdict path: " mdict_path
5+
if [ $mdict_path ]; then
6+
python3 init_mdict_path.py -m $mdict_path
7+
fi
8+
read -p "input audio path: " audio_path
9+
if [ $audio_path ]; then
10+
python3 init_mdict_path.py -a $audio_path
11+
fi
12+
fi
13+
source init_server_apt.sh
14+
python3 manage.py runserver 0.0.0.0:8000 --noreload

run_server_yum.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
file="mdict_path.json"
2+
if [ ! -f $file ]; then
3+
echo "set mdict path and audio path..."
4+
read -p "input mdict path: " mdict_path
5+
if [ $mdict_path ]; then
6+
python3 init_mdict_path.py -m $mdict_path
7+
fi
8+
read -p "input audio path: " audio_path
9+
if [ $audio_path ]; then
10+
python3 init_mdict_path.py -a $audio_path
11+
fi
12+
fi
13+
source init_server_yum.sh
14+
python3 manage.py runserver 0.0.0.0:8000 --noreload

0 commit comments

Comments
 (0)