-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_moodlehost
executable file
·33 lines (26 loc) · 1.02 KB
/
install_moodlehost
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
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "SORRY! This script must be run as root/superuser!"
exit 1
fi
cp ./moodlehost /usr/local/bin/moodlehost
# installing/updating the configuration file
if [ -f /etc/moodlehost.conf ]
then
echo "Found an existing '/etc/moodlehost.conf' file!."
else
cp ./moodlehost.conf /etc/moodlehost.conf
sudo chmod 755 /etc/moodlehost.conf
echo "A '/etc/moodlehost.conf' file has been placed and needs to be configured in order to finish the initial setup."
fi
echo "Please press any key to open that file with an editor, make any necessay changes and save them."
echo "The setup will continue after you have closed the editor."
read -n 1 -s
sudo nano /etc/moodlehost.conf
# check for the updated config file and read the settings
if [ ! -f /etc/moodlehost.conf ]
then
echo "No configuration file found at /etc/moodlehost.conf - aborting!"
exit 1
fi
echo "moodlehost is now installed. Change into a directory you want to host and issue 'moodlehost start' to start with default values"