Compare commits
No commits in common. "5dfcf87ce4b1ffb1973315acd8d41fd32b89f5a6" and "a890c6ae719c53ce593f17f6c98455781ad0907f" have entirely different histories.
5dfcf87ce4
...
a890c6ae71
3 changed files with 4 additions and 17 deletions
|
@ -4,7 +4,7 @@
|
||||||
"software": "x",
|
"software": "x",
|
||||||
"release": "latest",
|
"release": "latest",
|
||||||
"version": "1",
|
"version": "1",
|
||||||
"maxMemory": 2048,
|
|
||||||
"podman_network": "x",
|
"podman_network": "x",
|
||||||
"additional_ports": []
|
"additional_ports": [
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ function populateConfig() {
|
||||||
local software_url
|
local software_url
|
||||||
local release
|
local release
|
||||||
local version
|
local version
|
||||||
local maxMemory
|
|
||||||
|
|
||||||
# software
|
# software
|
||||||
log i "What would you like to install?"
|
log i "What would you like to install?"
|
||||||
|
@ -108,19 +107,7 @@ function populateConfig() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# maxMemory
|
jq "(.type=\"${runnertype}\")|(.build=${build})|(.software=\"${software}\")|(.release=\"${release}\")|(.version=\"${version}\")|(.podman_network=\"${network_name}\")" ${TEMPLATEDIR}/config.json > "${config}"
|
||||||
log i "How much memory (in MiB) do you want to allocate?"
|
|
||||||
while [[ -z ${maxMemoryAns} ]]; do
|
|
||||||
read -p "Answer: " maxMemoryAns
|
|
||||||
if [[ ${maxMemoryAns} -lt 2048 ]]; then
|
|
||||||
log e "max memory allocation can't be below 2048 MiB"
|
|
||||||
unset maxMemoryAns
|
|
||||||
else
|
|
||||||
maxMemory="${maxMemoryAns}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
jq "(.type=\"${runnertype}\")|(.build=${build})|(.software=\"${software}\")|(.release=\"${release}\")|(.version=\"${version}\")|(.maxMemory=${maxMemory})|(.podman_network=\"${network_name}\")" ${TEMPLATEDIR}/config.json > "${config}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkBackupDir() {
|
function checkBackupDir() {
|
||||||
|
|
|
@ -95,7 +95,7 @@ function startContainer() {
|
||||||
log d "Starting container '${1}'"
|
log d "Starting container '${1}'"
|
||||||
readarray -t additional_ports <<< "$(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} 'additional_ports[]')"
|
readarray -t additional_ports <<< "$(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} 'additional_ports[]')"
|
||||||
[[ ${#additional_ports} -gt 0 ]] && log d "Starting with additional ports: ${additional_ports[@]}"
|
[[ ${#additional_ports} -gt 0 ]] && log d "Starting with additional ports: ${additional_ports[@]}"
|
||||||
podman run --restart "unless-stopped" --replace --name "${1}" --userns=keep-id:uid=1000 --rm -it -d --network "${5}" -p $([[ -n "${4}" ]] && echo ${4}:)${3}:25565 $([[ ${#additional_ports} -gt 0 ]] && for port in "${additional_ports[@]}"; do echo "-p $([[ -n ${4} ]] && echo ${4}:)${port}:${port}"; done) -v $(getValueByKey 'PODMAN_DIRECTORY')/${1}/data:/var/server "${2}" java -Dcom.mojang.eula.agree=true -Xmx$(getLocalConfValue $(getValueByKey 'PODMAN_DIRECTORY')/${1} 'maxMemory')m -jar /var/exec/server.jar --nogui --port 25565
|
podman run --replace --name "${1}" --userns=keep-id:uid=1000 --rm -it -d --network "${5}" -p $([[ -n "${4}" ]] && echo ${4}:)${3}:25565 $([[ ${#additional_ports} -gt 0 ]] && for port in "${additional_ports[@]}"; do echo "-p $([[ -n ${4} ]] && echo ${4}:)${port}:${port}"; done) -v $(getValueByKey 'PODMAN_DIRECTORY')/${1}/data:/var/server "${2}" java -Dcom.mojang.eula.agree=true -jar /var/exec/server.jar --nogui --port 25565
|
||||||
[[ $? -eq 0 ]] && log s "Container '${1}' started!"
|
[[ $? -eq 0 ]] && log s "Container '${1}' started!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue