add --attach option to 'server start'

This commit is contained in:
LinuxSquare 2025-04-10 22:23:39 +02:00
parent 5b867a9599
commit 49788fc01e
2 changed files with 8 additions and 0 deletions

View file

@ -3,6 +3,7 @@
function server_help() {
usage_general
cat<<EOF
$(basename ${0}) {--attach}
commands:
create [servername] [network name]
start [servername] [port] (ip)
@ -74,6 +75,9 @@ function server_start() {
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() {

View file

@ -13,6 +13,7 @@ for util in ${ROOTPATH}/utils/*; do
done
# VARIABLES
declare DIRECTLY_ATTACH=0
declare debuglevel=3
function usage_general() {
@ -57,6 +58,9 @@ while true; do
-v|--verbose)
debuglevel=4
;;
--attach)
DIRECTLY_ATTACH=1
;;
*)
COMMAND="$1"
SUBCOMMAND="$2"