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

mainqndtest v1.1.1
Last change on this file since 42095c5 was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100644
File size: 1.9 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        admin_ok=false
42        while [ $admin_ok = false ];do
43                read -s -p "Enter rlabs admin password: " admin_passwd1
44                if [[ ${#admin_passwd1} -lt 5 ]]; then
45                        echo "Too short"
46                else
47                        echo ""
48                        read -s -p "Repeat rlabs admin password: " admin_passwd2
49                        if [ $admin_passwd1 = $admin_passwd2 ]; then
50                                admin_ok=true
51                        else
52                                echo ""
53                                echo "Passwords don't match."
54                        fi
55                fi
56        done
57               
58       
59fi
60
61systemctl stop uwsgi.service
62
63rm -fr $w2p_dir
64
65tar xf packages/web2py_rlabs.tar.gz -C packages/
66mv ./packages/web2py_rlabs $w2p_dir
67
68tar xf packages/web2py_source.tar.gz -C packages/
69cp -aR packages/web2py_source/* $w2p_dir/
70
71if [ $update = false ]; then
72        echo "SERVER_OPENGNSYS=$server_opengnsys" > $w2p_dir/setup_init.cfg
73        echo "AUTH_METHOD=$auth_method" >> $w2p_dir/setup_init.cfg
74        echo "ADMIN_RLABS=$admin_rlabs" >> $w2p_dir/setup_init.cfg
75        echo "ADMIN_PASSWD=$admin_passwd1" >> $w2p_dir/setup_init.cfg
76else
77        systemctl start uwsgi.service
78fi
79chown -R www-data.www-data $w2p_dir
80
81cp $w2p_dir/applications/rlabs/scripts/clear_fs_sessions.sh /etc/cron.daily/
Note: See TracBrowser for help on using the repository browser.