-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenmohaa_mohsh.json
122 lines (122 loc) · 8.12 KB
/
openmohaa_mohsh.json
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2024-12-10T21:55:02+02:00",
"name": "mohsh",
"author": "[email protected]",
"description": "Medal of Honor: Spearhead (OpenMoHAA)",
"features": null,
"docker_images": {
"quay.io\/ydrag0n\/mohaa": "quay.io\/ydrag0n\/mohaa"
},
"file_denylist": [],
"startup": ".\/omohaaded.x86_64 +set sv_punkbuster 0 +set fs_basepath {{BASE_PATH}} +set fs_outputpath {{LOG_DIR}} +set dedicated 2 +set sv_maxclients {{SERVER_MAXCLIENTS}} +set net_ip 0.0.0.0 +set net_port {{SERVER_PORT}} +set net_qport {{SERVER_QUERY_PORT}} +set net_gamespy_port {{SERVER_QUERY_PORT}} +set com_target_game 1 +exec server.cfg",
"config": {
"files": "{\r\n \"mainta\/server.cfg\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"seta sv_hostname\": \"seta sv_hostname \\\"{{env.SERVER_NAME}}\\\"\",\r\n \"seta sv_maxClients\": \"seta sv_maxClients \\\"{{env.SERVER_MAXCLIENTS}}\\\"\",\r\n \"seta rconPassword\": \"seta rconPassword \\\"{{env.RCON_PASSWORD}}\\\"\",\r\n \"seta sv_maxclients\": \"seta sv_maxClients \\\"{{env.SERVER_MAXCLIENTS}}\\\"\",\r\n \"seta rconpassword\": \"seta rconPassword \\\"{{env.RCON_PASSWORD}}\\\"\",\r\n \"seta g_password\": \"seta g_password \\\"{{env.SERVER_PASSWORD}}\\\"\",\r\n \"map\": \"map {{env.SERVER_MAP}}\",\r\n \"Map\": \"Map {{env.SERVER_MAP}}\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \"------ Server Initialization Complete ------\"\r\n}",
"logs": "{}",
"stop": "quit"
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n\r\n# Define constants\r\nSERVER_DIR=\"\/mnt\/server\"\r\nMOHAA_URL=\"https:\/\/moh.ftp.sh\/data\/MOH_MINI_LINUX.zip\"\r\nOPENMOHAA_URL=\"https:\/\/github.com\/openmoh\/openmohaa\/releases\/latest\/download\/openmohaa-v0.81.0-linux-amd64.zip\"\r\nDOWNLOAD_FILE=\"mohaaserver.zip\"\r\nOPENMOHAA_FILE=\"openmohaa.zip\"\r\nSERVER_EXE=\".\/omohaaded.x86_64\"\r\n\r\n# Function to log messages with timestamps\r\nlog_message() {\r\n echo -e \"[$(date +'%Y-%m-%d %H:%M:%S')] $1\"\r\n}\r\n\r\n# Function to check if a URL is valid\r\ncheck_url() {\r\n if curl --output \/dev\/null --silent --head --fail \"$1\"; then\r\n return 0\r\n else\r\n return 1\r\n fi\r\n}\r\n\r\n# Function to download a file from a URL\r\ndownload_file() {\r\n local url=\"$1\"\r\n local output=\"$2\"\r\n if curl -sSL \"$url\" -o \"$output\"; then\r\n log_message \"Successfully downloaded $output\"\r\n return 0\r\n else\r\n log_message \"Failed to download $output\"\r\n return 1\r\n fi\r\n}\r\n\r\n# Create server directory\r\nif ! mkdir -p \"$SERVER_DIR\"; then\r\n log_message \"Failed to create server directory\"\r\n exit 1\r\nfi\r\n\r\n# Change to the server directory\r\ncd \"$SERVER_DIR\" || { log_message \"Failed to change directory to $SERVER_DIR\"; exit 1; }\r\n\r\n# Validate and download MOHAA server files\r\nif [[ -n \"$MOHAA_URL\" ]]; then\r\n if check_url \"$MOHAA_URL\"; then\r\n if ! download_file \"$MOHAA_URL\" \"$DOWNLOAD_FILE\"; then\r\n exit 4\r\n fi\r\n else\r\n log_message \"Invalid MOHAA download URL. Exiting.\"\r\n exit 2\r\n fi\r\nelse\r\n log_message \"MOHAA_URL is not set. Exiting.\"\r\n exit 3\r\nfi\r\n\r\n# Unpack MOHAA server files\r\nlog_message \"Unpacking MOHAA server files\"\r\nif ! unzip \"$DOWNLOAD_FILE\"; then\r\n log_message \"Failed to unzip MOHAA server files\"\r\n exit 5\r\nfi\r\n\r\n# Clean up downloaded MOHAA zip file\r\nrm \"$DOWNLOAD_FILE\"\r\n\r\n# Check for and download server configuration if not present\r\nif [[ ! -f mainta\/server.cfg ]]; then\r\n log_message \"Downloading default server configuration\"\r\n if ! download_file \"$CONFIG_URL\" \"mainta\/server.cfg\"; then\r\n log_message \"Failed to download server configuration\"\r\n fi\r\nfi\r\n\r\n# Download OpenMoHAA files\r\nlog_message \"Downloading OpenMoHAA files\"\r\nif ! download_file \"$OPENMOHAA_URL\" \"$OPENMOHAA_FILE\"; then\r\n exit 7\r\nfi\r\n\r\n# Unpack OpenMoHAA files\r\nlog_message \"Unpacking OpenMoHAA files\"\r\nif ! unzip \"$OPENMOHAA_FILE\"; then\r\n log_message \"Failed to unzip openmohaa files\"\r\n exit 8\r\nfi\r\n\r\n# Clean up downloaded OpenMoHAA zip file\r\nrm \"$OPENMOHAA_FILE\"\r\n\r\n# Make the server executable\r\nlog_message \"Making $SERVER_EXE executable\"\r\nif ! chmod +x \"$SERVER_EXE\"; then\r\n log_message \"Failed to make $SERVER_EXE executable\"\r\n exit 6\r\nfi\r\n\r\n# Installation complete message\r\nlog_message \"Installation completed successfully\"",
"container": "quay.io\/ydrag0n\/mohaa",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Server Query Port",
"description": "Server query port (required to make your server listed on the game master server list).\r\n(SERVER_PORT+97)",
"env_variable": "SERVER_QUERY_PORT",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|max:5",
"field_type": "text"
},
{
"name": "Max clients",
"description": "",
"env_variable": "SERVER_MAXCLIENTS",
"default_value": "14",
"user_viewable": true,
"user_editable": true,
"rules": "required|integer",
"field_type": "text"
},
{
"name": "Config URL",
"description": "URL from where to get the initial server.cfg",
"env_variable": "CONFIG_URL",
"default_value": "https:\/\/raw.githubusercontent.com\/ysdragon\/MOHAA-Pterodactyl-Egg\/refs\/heads\/main\/server.cfg",
"user_viewable": false,
"user_editable": false,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Server name",
"description": "The name of the server",
"env_variable": "SERVER_NAME",
"default_value": "Unnamed OpenMoHAA server",
"user_viewable": true,
"user_editable": true,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Rcon password",
"description": "Admin password for rcon",
"env_variable": "RCON_PASSWORD",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Server map",
"description": "Select the map",
"env_variable": "SERVER_MAP",
"default_value": "obj\/obj_team2",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|in:obj\/obj_team2,dm\/mohdm7,dm\/mohdm1,dm\/mohdm3,dm\/mohdm2,dm\/mohdm6",
"field_type": "text"
},
{
"name": "Logs dir",
"description": "",
"env_variable": "LOG_DIR",
"default_value": "\/home\/container\/Logs",
"user_viewable": true,
"user_editable": false,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Base PATH",
"description": "",
"env_variable": "BASE_PATH",
"default_value": "\/home\/container",
"user_viewable": true,
"user_editable": false,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Server password",
"description": "",
"env_variable": "SERVER_PASSWORD",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
}
]
}