Compare commits

...

No commits in common. "main" and "code_refactor" have entirely different histories.

15 changed files with 428 additions and 277 deletions

2
.gitignore vendored
View file

@ -1,2 +0,0 @@
pms-cli.json
containers/

View file

@ -1,13 +0,0 @@
# pms-cli
The name stands for `Podman Minecraft-Server (commandline interface)`<br/>
It's sole job is, to help manage minecraft-servers running in podman containers.
It is possible to run one container with waterfall/velocity and other containers with paper.
To make a connection possible from the proxy to the slave-servers, you have to type `host.containers.internal` as the address and the respective port you've given to the server via the cli.
(**Important**: not the port defined in the `server.properties`)
**Important Notice:** If you're using this CLI for your own purpose, you agree to the terms and conditions of the [Minecraft EULA](https://www.minecraft.net/en-us/eula).
*This utility is not affiliated with Mojang AB or Microsoft, the developers of Minecraft.*

54
functions/backup Normal file
View file

@ -0,0 +1,54 @@
#!/usr/bin/env bash
function backup_help() {
usage_general
cat<<EOF
commands:
create [servername]
destroy [servername] [backup-name]
list [servername]
EOF
}
function backup_create() {
checkBackupDir "${1}"
local backupdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
local datadir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data"
tar -czf "$backupdir/${1}-$(date '+%d-%m-%Y_%T').tar.gz" \
-C "$datadir" logs/ \
-C "$datadir" plugins/ \
-C "$datadir" crash-reports \
-C "$datadir" world/ \
-C "$datadir" world_nether/ \
-C "$datadir" world_the_end/
}
function backup_destroy() {
checkBackupDir "${1}"
local backupdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
if [[ ! -f "${backupdir}/${2}.tar.gz" ]]; then
log e "Backup '${2}' does not exist! Check again using '$(basename 0) backup list'"
exit 1
fi
rm "${backupdir}/${2}.tar.gz"
}
function backup_list() {
checkBackupDir "${1}"
local backupdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
local found_backups=($(find "$backupdir" -type f -print))
if [[ "${#found_backups[@]}" -eq 0 ]]; then
log i "No backups found for '$1'"
exit 0
fi
log i "Found ${#found_backups[@]} backups:"
for backup in "${found_backups[@]}"; do
echo "- $(basename ${backup%%.*})"
done
}

53
functions/datapack Normal file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env bash
function datapack_help() {
usage_general
cat<<EOF
commands:
fetch [servername] [download-url]
delete [servername] [datapack-name]
list [servername]
EOF
}
function datapack_fetch() {
checkDatapackDir "${1}"
local datapack_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
local datapack_name="$(echo ${2} | awk -F/ '{print $NF}')"
if [[ -f "${datapack_dir}/${datapack_name}" ]]; then
log e "Datapack '${datapack_name}' does already exist!"
exit 1
fi
curl -L "${2}" -o "${datapack_dir}/${datapack_name}"
}
function datapack_delete() {
checkDatapackDir "${1}"
local datapack_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
if [[ ! -f "${datapack_dir}/${2}" ]]; then
log e "Datapack '${2}' does not exist! Check again using '$(basename 0) datapack list'"
exit 1
fi
rm "${datapack_dir}/${2}"
}
function datapack_list() {
checkDatapackDir "${1}"
local datapack_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
local found_datapacks=($(find "$datapack_dir" -maxdepth 1 -type f -print))
if [[ "${#found_datapacks[@]}" -eq 0 ]]; then
log i "No datapacks found for '$1'"
exit 0
fi
log i "Found ${#found_datapacks[@]} datapacks:"
for datapack in "${found_datapacks[@]}"; do
echo "- $(basename ${datapack})"
done
}

53
functions/plugin Normal file
View file

@ -0,0 +1,53 @@
#!/usr/bin/env bash
function plugin_help() {
usage_general
cat<<EOF
commands:
fetch [servername] [download-url]
delete [servername] [plugin-name]
list [servername]
EOF
}
function plugin_fetch() {
checkPluginDir "${1}"
local plugin_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/plugins"
local plugin_name="$(echo ${2} | awk -F/ '{print $NF}')"
if [[ -f "${plugin_dir}/${plugin_name}" ]]; then
log e "Plugin '${plugin_name}' does already exist!"
exit 1
fi
curl -L "${2}" -o "${plugin_dir}/${plugin_name}"
}
function plugin_delete() {
checkPluginDir "${1}"
local plugin_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/plugins"
if [[ ! -f "${plugin_dir}/${2}" ]]; then
log e "Plugin '${2}' does not exist! Check again using '$(basename 0) plugin list'"
exit 1
fi
rm "${plugin_dir}/${2}"
}
function plugin_list {
checkPluginDir "${1}"
local plugin_dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/plugins"
local found_plugins=($(find "$plugin_dir" -iname "*.jar" -maxdepth 1 -type f -print | tr ' ' ';'))
if [[ "${#found_plugins[@]}" -eq 0 ]]; then
log i "No plugins found for '$1'"
exit 0
fi
log i "Found ${#found_plugins[@]} plugins:"
for plugin in "${found_plugins[@]}"; do
echo "- $(basename ${plugin} | tr ';' ' ')"
done
}

176
functions/server Normal file
View file

@ -0,0 +1,176 @@
#!/usr/bin/env bash
function server_help() {
usage_general
cat<<EOF
$(basename ${0}) {--attach}
commands:
create [servername] [network name]
start [servername] [port] <ip>
stop [servername]
restart [servername] [port] <ip>
attach [servername]
reset [servername]
delete [servername]
EOF
}
function server_create() {
createNetwork "${2}"
if [[ -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' already exists!"
exit 1
fi
local newdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
mkdir -p "${newdir}/data/world/datapacks"
populateConfig "${newdir}/config.json" "${2}"
}
function server_start() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
if [[ -z "${2}" ]]; then
log e "You have to specify a port, on which the server listens!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
local software="$(getLocalConfValue ${dir} 'software')"
local version="$(getLocalConfValue ${dir} 'version')"
local build="$(getLocalConfValue ${dir} 'build')"
local podman_network="$(getLocalConfValue ${dir} 'podman_network')"
case "$(getLocalConfValue ${dir} 'type')" in
"server")
local software_url="$(getValueByKey SERVERRUNNERS.${software})"
;;
"proxy")
local software_url="$(getValueByKey PROXYRUNNERS.${software})"
;;
esac
if [[ $(checkImage "${software}" "${version}" "${build}") == false ]]; then
log i "Building image '${version}/${software}:${build}'"
buildImage "${software}" "${version}" "${build}" "${software_url}/versions/${version}/builds/${build}"
else
if [[ "$(getLocalConfValue ${dir} 'release')" == "latest" ]]; then
if [[ $(checkUpdate "${software}" "${version}" "${build}" "$(getLocalConfValue ${dir} 'type')") == true ]]; then
log w "Update for '${software}/${version}:${build}' is available."
updateBuild "${software}" "${version}" "${dir}" "$(getLocalConfValue ${dir} 'type')"
local oldbuild="${build}"
build="$(getLocalConfValue ${dir} 'build')"
if [[ $(checkImage "${software}" "${version}" "${build}") == false ]]; then
log i "Updating image '${version}/${software}:${oldbuild}' => '${version}/${software}:${build}'"
buildImage "${software}" "${version}" "${build}" "${software_url}/versions/${version}/builds/${build}"
fi
fi
fi
fi
log i "Starting container '${1}' with image '${version}/${software}:${build}' on port '$([[ -n "${3}" ]] && echo ${3}:)${2}'"
startContainer "${1}" "${version}/${software}:${build}" "${2}" "${3}" "${podman_network}"
if (( DIRECTLY_ATTACH )); then
server_attach "${1}"
fi
}
function server_stop() {
if [[ -z $(podman container ps | grep "${1}") ]]; then
log w "Container '${1}' is not running!"
return 1
fi
log i "Stopping container '${1}'"
stopContainer "${1}"
}
function server_restart() {
server_stop "${1}"
server_start "${1}" "${2}" "${3}"
}
function server_attach() {
if [[ -z $(podman container ps | grep "${1}") ]]; then
log e "Container '${1}' is not running!"
exit 1
fi
log i "Attaching to container '${1}'"
podman container attach "${1}"
}
function server_reset() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
local datapack_dir="${dir}/data/world/datapacks"
while [[ ! ${deleteDataDir} =~ [YyNn] ]]; do
read -p "Do you want to reset the complete data dir located in ${dir}/data ? (This is an unrecoverable process): " deleteDataDir
case "${deleteDataDir}" in
"N"|"n")
log e "Aborted by user!"
exit 1
;;
esac
done
local backedup=false
if [[ -n $(find "${datapack_dir}" -maxdepth 1 -type f) ]]; then
while [[ ! ${backupDatapacksAns} =~ [YyNn] ]]; do
read -p "Do you want to backup the datapack .zip found in ${datapack_dir} ?: " backupDatapacksAns
case "${backupDatapacksAns}" in
"Y"|"y")
local backedup=true
local tempdir=$(mktemp -d /tmp/pms-cli.XXXXXX)
mv ${datapack_dir}/*.zip ${tempdir}/
;;
esac
done
fi
rm -rf "${dir}/data"
mkdir -p "${dir}/data/world/datapacks"
if [[ "${backedup}" == true ]]; then
while [[ ! ${restoreDatapacksAns} =~ [YyNn] ]]; do
read -p "You have some backed up datapack .zip in ${tempdir}. Do you want to restore them now?: " restoreDatapacksAns
case "${restoreDatapacksAns}" in
"Y"|"y")
mv ${tempdir}/*.zip "${dir}/data/world/datapacks/"
rm -rf "${tempdir}"
;;
esac
done
fi
log s "Server '${1}' resetted!"
}
function server_delete() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local delDir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
while [[ ! ${deleteAns} =~ [YyNn] ]]; do
read -p "Do you really want to delete the complete directory located in ${delDir} ? (This is an unrecoverable process): " deleteAns
case "${deleteAns}" in
"N"|"n")
log e "Aborted by user!"
exit 1
;;
esac
done
rm -rf "${delDir}"
log s "Server '${1}' deleted!"
}

139
pms-cli
View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# CONSTANTS
readonly PKGVER="0.2.5"
# CONTANTS
readonly PKGVER="1.0.0"
readonly LICENSE="GNU AGPLv3"
readonly ROOTPATH="$(dirname $(readlink -f $(which ${0})))"
readonly TEMPLATEDIR="${ROOTPATH}/.template"
@ -13,107 +13,76 @@ for util in ${ROOTPATH}/utils/*; do
done
# VARIABLES
declare DIRECTLY_ATTACH=0
declare debuglevel=3
function usage() {
echo -e "usage: $(basename ${0}) <operation> [...]
function usage_general() {
cat <<EOF
usage: $(basename $0) <operation> [subcommand]
operations:
$(basename ${0}) {-h --help}
$(basename ${0}) {-V --version}
$(basename ${0}) {-v --verbose}
$(basename ${0}) {--init} [servername] [network name]
$(basename ${0}) {--datapack} [servername] [datapack dl url]
$(basename ${0}) {--start} [servername] [port] (ip)
$(basename ${0}) {--stop} [servername]
$(basename ${0}) {--restart} [servername] [port] (ip)
$(basename ${0}) {--attach} [servername]
$(basename ${0}) {--reset} [servername]
$(basename ${0}) {--delete} [servername]"
$(basename ${0}) {-h --help}
$(basename ${0}) {-V --version}
$(basename ${0}) {-v --verbose}
EOF
}
function usage() {
usage_general
cat<<EOF
subcommands:
$(basename ${0}) server
$(basename ${0}) backup
$(basename ${0}) plugin
$(basename ${0}) datapack
EOF
}
function version() {
echo -e "Minecraft Podman Server v${PKGVER}
Copyright (C) 2024 Noveria Network
Copyright (C) $(date +%Y) Noveria Network
This program may be freely redistributed under
the terms of the ${LICENSE}"
}
###
## SCRIPT START
###
OPT_SHORT="hVv"
OPT_LONG="help,version,verbose,init:,datapack:,start:,stop:,restart:,attach:,reset:,delete:"
TEMP=$(getopt -o ${OPT_SHORT} --long ${OPT_LONG} -n $(basename ${0}) -- "$@")
if [ "$?" != 0 ]; then
usage
exit 1
fi
eval set -- "${TEMP}"
while true; do
case "${1}" in
case "$1" in
-h|--help)
usage
exit 0
;;
usage
exit 0
;;
-V|--version)
version
exit 0
;;
version
exit 0
;;
-v|--verbose)
debuglevel=4
;;
--init)
shift
init "${1}" "${3}"
;;
--datapack)
shift
datapack "${1}" "${3}"
;;
--start)
shift
start "${1}" "${3}" "${4}"
;;
--stop)
shift
stop "${1}"
;;
--restart)
shift
stop "${1}"
start "${1}" "${3}" "${4}"
;;
debuglevel=4
;;
--attach)
shift
attach "${1}"
;;
--reset)
shift
stop "${1}"
reset "${1}"
;;
--delete)
shift
stop "${1}"
delete "${1}"
;;
--)
shift
break
;;
DIRECTLY_ATTACH=1
;;
*)
log w "${1} is not a valid parameter. Please refer to '$(basename ${0}) -h' for help!"
break
;;
COMMAND="$1"
SUBCOMMAND="$2"
shift; shift
PARAMS="$@"
break
esac
shift
done
###
## SCRIPT END
###
if ! find "$ROOTPATH/functions" -iname "$COMMAND" &> /dev/null; then
log e "'$COMMAND' is not a viable function!"
exit 1
fi
if ! grep "$SUBCOMMAND" "$ROOTPATH/functions/$COMMAND" &> /dev/null; then
log e "'$SUBCOMMAND' is not viable command in '$COMMAND'"
exit 1
fi
source "$ROOTPATH/functions/$COMMAND"
if [[ -z "$SUBCOMMAND" ]]; then
"${COMMAND}_help"
exit 1
fi
"${COMMAND}_${SUBCOMMAND}" ${PARAMS[@]}

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
function attach() {
if [[ -z $(podman container ps | grep "${1}") ]]; then
log e "Container '${1}' is not running!"
exit 1
fi
log i "Attaching to container '${1}'"
podman container attach "${1}"
}

View file

@ -1,12 +0,0 @@
#!/usr/bin/env bash
function datapack() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
curl -L "${2}" -o "${dir}/$(echo ${2} | awk -F/ '{print $NF}')"
}

View file

@ -1,23 +0,0 @@
#!/usr/bin/env bash
function delete() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local delDir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
while [[ ! ${deleteAns} =~ [YyNn] ]]; do
read -p "Do you really want to delete the complete directory located in ${delDir} ? (This is an unrecoverable process): " deleteAns
case "${deleteAns}" in
"N"|"n")
log e "Aborted by user!"
exit 1
;;
esac
done
rm -rf "${delDir}"
log s "Server '${1}' deleted!"
}

View file

@ -1,18 +1,5 @@
#!/usr/bin/env bash
function init() {
createNetwork "${2}"
if [[ -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' already exists!"
exit 1
fi
local newdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
mkdir -p "${newdir}/data/world/datapacks"
populateConfig "${newdir}/config.json" "${2}"
}
function populateConfig() {
local config="${1}"
local network_name="${2}"
@ -23,7 +10,7 @@ function populateConfig() {
local software_url
local release
local version
# software
log i "What would you like to install?"
while [[ ! ${softwareAns} =~ [1-2] ]]; do
@ -53,7 +40,7 @@ function populateConfig() {
2)
runnertype="proxy"
log i "Which proxy-software would you like to install?"
local proxies=($(getValueByKey 'PROXYRUNNERS|keys[]'))
local proxies=($(getValueByKey 'PROXYRUNNERS|keys[]'))
while [[ ! ${proxyAns} =~ [0-9] ]]; do
for (( i = 0; i<${#proxies[@]}; i++ )); do
if [[ -n ${proxies[${i}]} ]]; then
@ -78,7 +65,7 @@ function populateConfig() {
# version
log i "Which version of '${software}' would you like to install?"
local versions=($(curl -s "${software_url}" | jq -r '.versions[]' ))
while [[ -z ${versionAns} ]]; do
for (( i = 0; i<${#versions[@]}; i++ )); do
echo "[$((${i} + 1))] ${versions[${i}]}"
@ -122,3 +109,33 @@ function populateConfig() {
jq "(.type=\"${runnertype}\")|(.build=${build})|(.software=\"${software}\")|(.release=\"${release}\")|(.version=\"${version}\")|(.podman_network=\"${network_name}\")" ${TEMPLATEDIR}/config.json > "${config}"
}
function checkBackupDir() {
if [[ -z "$1" ]]; then
log e "Parameters can't be empty!"
exit 1
fi
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup" ]]; then
mkdir -p "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
fi
}
function checkDatapackDir() {
if [[ -z "$1" ]]; then
log e "Parameters can't be empty!"
exit 1
fi
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks" ]]; then
mkdir -p "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/world/datapacks"
fi
}
function checkPluginDir() {
if [[ -z "$1" ]]; then
log e "Parameters can't be empty!"
exit 1
fi
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/plugins" ]]; then
mkdir -p "$(getValueByKey 'PODMAN_DIRECTORY')/${1}/data/plugins"
fi
}

View file

@ -5,7 +5,7 @@ readonly IMAGEDIR=${ROOTPATH}/image
##
# checks if the defined image exists already
#
#
# ${1} - string: software-name
# ${2} - string: mc-version
# ${3} - string: build-number
@ -16,7 +16,7 @@ function checkImage() {
##
# checks if the passed data is up-to-date
#
#
# ${1} - string: software-name
# ${2} - string: mc-version
# ${3} - string: build-number
@ -40,13 +40,13 @@ function checkUpdate() {
##
# updates the config-file to the latest build
#
#
# ${1} - string: software-name
# ${2} - string: mc-version
# ${3} - string: config-dir
# ${4} - string: runner-type
##
function updateBuild() {
function updateBuild() {
case "${4}" in
"server")
local latest=$(curl -s "$(getValueByKey SERVERRUNNERS.${1})/versions/${2}" | jq -r '.builds | last')
@ -61,7 +61,7 @@ function updateBuild() {
##
# builds the podman image with the proper settings
#
#
# ${1} - string: software-name
# ${2} - string: mc-version
# ${3} - string: build-number

View file

@ -1,51 +0,0 @@
#!/usr/bin/env bash
function reset() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
local datapack_dir="${dir}/data/world/datapacks"
while [[ ! ${deleteDataDir} =~ [YyNn] ]]; do
read -p "Do you want to reset the complete data dir located in ${dir}/data ? (This is an unrecoverable process): " deleteDataDir
case "${deleteDataDir}" in
"N"|"n")
log e "Aborted by user!"
exit 1
;;
esac
done
local backedup=false
if [[ -n $(find "${datapack_dir}" -maxdepth 1 -type f) ]]; then
while [[ ! ${backupDatapacksAns} =~ [YyNn] ]]; do
read -p "Do you want to backup the datapack .zip found in ${datapack_dir} ?: " backupDatapacksAns
case "${backupDatapacksAns}" in
"Y"|"y")
local backedup=true
local tempdir=$(mktemp -d /tmp/pms-cli.XXXXXX)
mv ${datapack_dir}/*.zip ${tempdir}/
;;
esac
done
fi
rm -rf "${dir}/data"
mkdir -p "${dir}/data/world/datapacks"
if [[ "${backedup}" == true ]]; then
while [[ ! ${restoreDatapacksAns} =~ [YyNn] ]]; do
read -p "You have some backed up datapack .zip in ${tempdir}. Do you want to restore them now?: " restoreDatapacksAns
case "${restoreDatapacksAns}" in
"Y"|"y")
mv ${tempdir}/*.zip "${dir}/data/world/datapacks/"
rm -rf "${tempdir}"
;;
esac
done
fi
log s "Server '${1}' resetted!"
}

View file

@ -1,50 +0,0 @@
#!/usr/bin/env bash
function start() {
if [[ ! -d "$(getValueByKey 'PODMAN_DIRECTORY')/${1}" ]]; then
log e "Directory '${1}' does not exist!"
exit 1
fi
if [[ -z "${2}" ]]; then
log e "You have to specify a port, on which the server listens!"
exit 1
fi
local dir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}"
local software="$(getLocalConfValue ${dir} 'software')"
local version="$(getLocalConfValue ${dir} 'version')"
local build="$(getLocalConfValue ${dir} 'build')"
local podman_network="$(getLocalConfValue ${dir} 'podman_network')"
case "$(getLocalConfValue ${dir} 'type')" in
"server")
local software_url="$(getValueByKey SERVERRUNNERS.${software})"
;;
"proxy")
local software_url="$(getValueByKey PROXYRUNNERS.${software})"
;;
esac
if [[ $(checkImage "${software}" "${version}" "${build}") == false ]]; then
log i "Building image '${version}/${software}:${build}'"
buildImage "${software}" "${version}" "${build}" "${software_url}/versions/${version}/builds/${build}"
else
if [[ "$(getLocalConfValue ${dir} 'release')" == "latest" ]]; then
if [[ $(checkUpdate "${software}" "${version}" "${build}" "$(getLocalConfValue ${dir} 'type')") == true ]]; then
log w "Update for '${software}/${version}:${build}' is available."
updateBuild "${software}" "${version}" "${dir}" "$(getLocalConfValue ${dir} 'type')"
local oldbuild="${build}"
build="$(getLocalConfValue ${dir} 'build')"
if [[ $(checkImage "${software}" "${version}" "${build}") == false ]]; then
log i "Updating image '${version}/${software}:${oldbuild}' => '${version}/${software}:${build}'"
buildImage "${software}" "${version}" "${build}" "${software_url}/versions/${version}/builds/${build}"
fi
fi
fi
fi
log i "Starting container '${1}' with image '${version}/${software}:${build}' on port '$([[ -n "${3}" ]] && echo ${3}:)${2}'"
startContainer "${1}" "${version}/${software}:${build}" "${2}" "${3}" "${podman_network}"
}

View file

@ -1,10 +0,0 @@
#!/usr/bin/env bash
function stop() {
if [[ -z $(podman container ps | grep "${1}") ]]; then
log w "Container '${1}' is not running!"
return 1
fi
log i "Stopping container '${1}'"
stopContainer "${1}"
}