-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_moodle_docker.sh
46 lines (35 loc) · 1.16 KB
/
install_moodle_docker.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
#!/bin/bash -i
HOME_DIR=$(dscl . -read /Users/$(whoami) NFSHomeDirectory | awk '{print $NF}')
DESTDIR="$HOME_DIR/moodle-docker-brew"
if [ ! -d "$DESTDIR" ]; then
echo "Installing (moodle-docker-brew)"
echo "Installing to: $DESTDIR"
# Check if unzip is installed
if ! command -v unzip >/dev/null 2>&1; then
echo "Error: unzip is required to extract the Moodle version."
exit 1
fi
# Check if git is installed
if ! command -v git >/dev/null 2>&1; then
echo "Error: git is required."
exit 1
fi
# Search for the application in the /Applications directory
if [ ! -d "/Applications/OrbStack.app" ]; then
echo "Error: Orbstack is not installed, please install it first."
exit 1
fi
echo "Cloning (moodle-docker-brew)"
git clone [email protected]:LdesignMedia/moodle-docker-brew.git "$DESTDIR"
if [ -d "$DESTDIR" ]; then
cd "$DESTDIR" || exit
git clone [email protected]:moodlehq/moodle-docker.git moodlehq-docker
chmod +x "$DESTDIR/moodle-docker"
else
echo "Error: installing failed.."
exit 1
fi
echo "Finished installing dependencies"
else
exec /bin/bash -i "$HOME_DIR"/moodle-docker-brew/moodle-docker "$@"
fi