diff --git a/scripts/.screenrc_tv_panel b/scripts/.screenrc_tv_panel index 5688bc404564e47e733f01a208b10835b717e09e..538da0a7ff9d39f0d0030a423990666085818d3f 100755 --- a/scripts/.screenrc_tv_panel +++ b/scripts/.screenrc_tv_panel @@ -29,8 +29,6 @@ bind f eval "hardstatus ignore" bind F eval "hardstatus alwayslastline" # Windows at startup -screen -t "tvp_back" 0 bash -c 'cd /home/hermod/tv_panel && yarn start:prod' -screen -t "tvp_front" 1 bash -c 'cd /home/hermod/tv_panel && yarn start:front' -screen -t "tvp_chromium" 2 bash -c 'cd /home/hermod/tv_panel && DISPLAY=:0 ./front/start.sh' -screen -t bash 3 bash -select 3 +screen -t "tvp_chromium" 0 bash -c 'DISPLAY=:0 xdotool mousemove 10000 10000 && chromium-browser --kiosk --incognito --disable-gpu http://localhost:5000' +screen -t bash 1 bash +select 1 diff --git a/scripts/update_server.sh b/scripts/update_server.sh index c59ad3adbb48c58a1c33996ff16722c84ef88d13..31cff824509f91ca97832d96183eac539eb37ffc 100755 --- a/scripts/update_server.sh +++ b/scripts/update_server.sh @@ -1,21 +1,35 @@ #!/bin/bash -if [ $NODE_ENV = "production" ] +if [[ "$NODE_ENV" != "production" ]] then - # Pull code - git fetch - # git reset --hard origin/master + read -p "The env if not production, this script can remove uncommitted changes. Are you sure you want to continue? [y/N] " prompt + if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]] + then + echo "Pursuing..." + else + echo "Aborted." + exit 1 + fi +fi - # Install deps - yarn install --pure-lockfile +# Pull code +echo "Fetching the code..." +git fetch +# git reset --hard origin/master - # Build front - yarn build:front +# Install deps +echo "Installing dependencies..." +yarn install --pure-lockfile - # Restart server - # pm2 startOrRestart ./scripts/ecosystem.config.json +# Build front +echo "Building front-end..." +yarn build:front - # Restart screen - # screen -S TVPanelScreen -X quit - # ./scripts/start_tv_panel.sh -fi \ No newline at end of file +# Restart server +echo "Restarting the back-end server..." +pm2 startOrRestart ./scripts/ecosystem.config.json + +# Restart screen +echo "Restarting the screen..." +screen -S TVPanelScreen -X quit +./scripts/start_tv_panel.sh