waitlist update script
SpeedProg Apr 20th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- echo "Changed directory to /opt/waitlist"
- #stop the waitlist
- echo "Stopped waitlist"
- if [ -f stattool_config.js ]; then
- rm stattool_config.js
- cp static/js/config/stattool_config.js ./
- if [ -f gong-sound.mp3 ]; then
- rm gong-sound.mp3
- cp static/gong-sound.mp3 ./
- echo "Backed up gong-sound.mp3 and stattool_config.js"
- rm -rf static/gen/ static/js static/css migrations/ templates/ themes/ waitlist translations
- # extract new files
- tar -xzf wl-current.tar.gz
- echo "Extracted waitlist files"
- mv stattool_config.js static/js/config/
- echo "Restored stattool_config.js"
- mv gong-sound.mp3 static/
- echo "Restored gong-sound.mp3"
- # get into python venv
- source /opt/python-env/waitlist37/bin/activate
- echo "Python VENV activated"
- pip install -q -r requirements.txt
- echo "Requirements updated"
- npm i
- echo "Node requirements updated"
- pybabel compile -d translations
- echo "Translations compiled"
- # upgrade db schema
- python manager.py db upgrade
- echo "Database migrations ran"
- # start wl and write pid to file
- nohup python main.py >> stdfiles.out 2>&1 &
- echo $! > "$PIDFile"
- echo "Waitlist started"
RAW Paste Data