-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathmain.sh
More file actions
70 lines (52 loc) · 1.57 KB
/
main.sh
File metadata and controls
70 lines (52 loc) · 1.57 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash -e
#set -o xtrace
set -e
echo "----------------------"
echo "Starting AMP-Dockerized..."
echo "----------------------"
echo "Note: This is an UNOFFICIAL IMAGE for CubeCoders AMP. This was created by the community, NOT CubeCoders."
echo "Please, DO NOT contact CubeCoders (Discord or otherwise) for technical support when using this image."
echo "They do not support nor endorse this image and will not help you."
echo "Instead, please direct support requests to https://github.com/MitchTalmadge/AMP-dockerized/issues."
echo "Thank you!!"
echo "----------------------"
echo ""
source /opt/entrypoint/utils.sh
source /opt/entrypoint/routines.sh
trap 'handle_error' ERR
trap_with_arg 'shutdown' INT TERM HUP QUIT KILL
# Set JAVA_HOME based on architecture
detect_architecture() {
if [ "$(uname -m)" = "aarch64" ]; then
export JAVA_HOME="/usr/lib/jvm/temurin-25-jdk-arm64"
else
export JAVA_HOME="/usr/lib/jvm/temurin-25-jdk-amd64"
fi
echo "Setting JAVA_HOME to: $JAVA_HOME"
}
detect_architecture
check_data_volume
# Legacy naming
if [ ! -z "${NIGHTLY}" ]; then
export AMP_RELEASE_STREAM="Development"
fi
run_startup_script
create_group_user
create_amp_user
configure_timezone
check_file_permissions
configure_main_instance
configure_release_stream
configure_license
amp_host_home
if [ "${AMP_AUTO_UPDATE}" = "true" ]; then
upgrade_instances
else
echo "Skipping automatic updates."
fi
start_amp
# Sleep
echo "AMP is now running. Logs can be viewed through AMP web UI or at ampdata/instances/Main/AMP_Logs"
monitor_amp &
tail -f /dev/null &
wait $!