Compare commits
2 Commits
a7b30a4bf1
...
93778d03af
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93778d03af | ||
|
|
7b7e6e06fb |
@ -31,28 +31,25 @@ dockerComposeDown()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$OS_TYPE" == "Ubuntu" || "$OS_TYPE" == "Debian" ]]; then
|
if [[ "$OS_TYPE" == "Ubuntu" || "$OS_TYPE" == "Debian" ]]; then
|
||||||
if [ -f "$containers_dir$app_name/$compose_file" ]; then
|
if [ ! -f "$containers_dir$app_name/$compose_file" ]; then
|
||||||
# Used for the standard LibrePortal app
|
|
||||||
if [[ "$type" == "" ]]; then
|
|
||||||
if [[ $CFG_DOCKER_INSTALL_TYPE == "rootless" ]]; then
|
|
||||||
local result=$(dockerCommandRunInstallUser "cd $containers_dir$app_name && docker compose $setup_compose down" >/dev/null 2>&1)
|
|
||||||
checkSuccess "Shutting down container for $app_name"
|
|
||||||
elif [[ $CFG_DOCKER_INSTALL_TYPE == "rooted" ]]; then
|
|
||||||
local result=$(cd "$containers_dir$app_name" && sudo docker compose $setup_compose down >/dev/null 2>&1)
|
|
||||||
checkSuccess "Shutting down container for $app_name"
|
|
||||||
fi
|
|
||||||
# Used for the CLI dockertype switcher.
|
|
||||||
else
|
|
||||||
if [[ $type == "rootless" ]]; then
|
|
||||||
local result=$(dockerCommandRunInstallUser "cd $containers_dir$app_name && docker compose $setup_compose down" >/dev/null 2>&1)
|
|
||||||
checkSuccess "Shutting down container for $app_name"
|
|
||||||
elif [[ $type == "rooted" ]]; then
|
|
||||||
local result=$(cd "$containers_dir$app_name" && sudo docker compose $setup_compose down >/dev/null 2>&1)
|
|
||||||
checkSuccess "Shutting down container for $app_name"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
isNotice "Unable to find the compose file to docker compose down this application."
|
isNotice "Unable to find the compose file to docker compose down this application."
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Explicit type arg (CLI dockertype switcher) wins, otherwise the
|
||||||
|
# configured install type. Every branch ends in a status line so the
|
||||||
|
# header is never left without output.
|
||||||
|
local mode="${type:-$CFG_DOCKER_INSTALL_TYPE}"
|
||||||
|
if [[ $mode == "rootless" ]]; then
|
||||||
|
local result=$(dockerCommandRunInstallUser "cd $containers_dir$app_name && docker compose $setup_compose down" >/dev/null 2>&1)
|
||||||
|
checkSuccess "Shutting down container for $app_name"
|
||||||
|
elif [[ $mode == "rooted" ]]; then
|
||||||
|
local result=$(cd "$containers_dir$app_name" && sudo docker compose $setup_compose down >/dev/null 2>&1)
|
||||||
|
checkSuccess "Shutting down container for $app_name"
|
||||||
|
else
|
||||||
|
isNotice "Unknown Docker install type '$mode' — cannot shut down $app_name."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
isNotice "Unsupported OS '$OS_TYPE' — cannot shut down $app_name."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user