forked from agama-project/agama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·52 lines (43 loc) · 1.26 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# This script sets up the development environment without installing Agama
# packages. This script is supposed to run within a git repository clone.
# Exit on error; unset variables are an error.
set -eu
MYDIR=$(realpath $(dirname $0))
# Helper:
# Ensure root privileges for the installation.
# In a testing container, we are root but there is no sudo.
if [ $(id --user) != 0 ]; then
SUDO=sudo
if [ $($SUDO id --user) != 0 ]; then
echo "We are not root and cannot sudo, cannot continue."
exit 1
fi
else
SUDO=""
fi
# Services setup
if ! $MYDIR/setup-services.sh; then
echo "Services setup failed."
echo "Agama services are NOT running."
exit 2
fi;
# Web setup
if ! $MYDIR/setup-web.sh; then
echo "Web client setup failed."
echo "Agama web client is NOT running."
exit 3
fi;
# Start the installer.
echo
echo "The configured Agama services can be manually started with these commands:"
echo
echo " $SUDO systemctl start agama.service"
echo " $SUDO systemctl start agama-web-server.service"
echo
echo "Visit http://localhost"
echo
echo "Note: If the firewall is running and you want to access the Agama installer"
echo "remotely then you need to open the firewall port with:"
echo
echo " $SUDO firewall-cmd --zone=public --add-service=https"