source: OpenRLabs-Git/deploy/rlabs_installer/02_install_web2py_rlabs.sh

qndtest
Last change on this file was bef6a5f, checked in by David Fuertes <dfuertes@…>, 3 years ago

Redirect docker https

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#!/bin/bash
2
3update=false
4if [ $# = 1 ];then
5        if [ $1 = "update" ]; then
6                update=true
7        fi
8fi
9
10echo "+------------------------------------------+"
11echo "|                                          |"
12echo "|    Installing OPENRLABS WEB2PY APP       |"
13echo "|                                          |"
14echo "+------------------------------------------+"
15
16
17
18read -p "Enter rlabs directory [default:/var/www/web2py]: " w2p_dir
19w2p_dir=${w2p_dir:-/var/www/web2py}
20
21echo $w2p_dir > tmp/w2p_dir.tmp
22
23
24if [ $update = false ]; then
25        read -p "Enter Server OPENGNSYS IP or Domain: " server_opengnsys
26       
27        if [ "$server_opengnsys" = "" ]; then
28                echo "Server OPENGNSYS IP or Domain is needed as argument"
29                exit 0
30        fi
31       
32       
33                               
34        read -p "Enter rlabs admin user [Example: foo]. " admin_rlabs
35       
36        if [ "$admin_rlabs" = "" ]; then
37                        echo "admin user is needed as argument"
38                        exit 0
39        fi
40                       
41        read -p "Current passwd for $admin_rlabs is 'admin'. Please change it after first login!!"
42fi
43
44systemctl stop uwsgi.service
45
46rm -fr $w2p_dir
47
48tar xf packages/web2py_rlabs.tar.gz -C packages/
49mv ./packages/web2py_rlabs $w2p_dir
50
51tar xf packages/web2py_source.tar.gz -C packages/
52cp -aR packages/web2py_source/* $w2p_dir/
53
54if [ $update = false ]; then
55        echo "SERVER_OPENGNSYS=$server_opengnsys" > $w2p_dir/setup_init.cfg
56        echo "AUTH_METHOD=$auth_method" >> $w2p_dir/setup_init.cfg
57        echo "ADMIN_RLABS=$admin_rlabs" >> $w2p_dir/setup_init.cfg     
58else
59        systemctl start uwsgi.service
60fi
61chown -R www-data.www-data $w2p_dir
62
63w2p_dir_orig sh= "/var/www/web2py/"
64w2p_dir_orig_scaped=$(echo $w2p_dir_orig | sed 's/\//\\\//g')
65
66w2p_dir_scaped=$(echo $w2p_dir | sed 's/\//\\\//g')
67
68sed -i -e "s/$w2p_dir_orig_scaped/$w2p_dir_scaped/g"  $w2p_dir/applications/rlabs/scripts/clear_fs_sessions.sh
69echo "0 1 * * * root $w2p_dir/applications/rlabs/scripts/clear_fs_sessions.sh" > /etc/cron.d/w2p_clear_sessions
70
71
72sed -i -e "s/$w2p_dir_orig_scaped/$w2p_dir_scaped/g"  $w2p_dir/applications/rlabs/scripts/exec_bg_check.sh
73echo "* * * * * root $w2p_dir/applications/rlabs/scripts/exec_bg_check.sh" > /etc/cron.d/w2p_bg_check
Note: See TracBrowser for help on using the repository browser.