summaryrefslogtreecommitdiff
path: root/utils/lxc.sh
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-04-13 11:34:28 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2020-04-13 11:34:28 +0200
commit99ff16c465ed4d3b98041bf308dfeb0918b535ab (patch)
tree0fe9838cd97b985d37eb9f12f29a9a9383d6d2cd /utils/lxc.sh
parent58d5da8b57c5aeab92f551e8d175be67537c351c (diff)
downloadsearxng-99ff16c465ed4d3b98041bf308dfeb0918b535ab.tar.gz
searxng-99ff16c465ed4d3b98041bf308dfeb0918b535ab.zip
tooling box: added nginx + polished bash scripts and environment
- add installation method for nginx sites, morty and filtron - clean up PUBLIC_URL environment in and outside of containers - clean up comand lines - handle uWSGI quirks on fedora (emperor mode) - handle Python quirks on debian (there is no 'python' command anymore) - lib.sh: add die and die_caller functions - lxc_suite_install_info is now a function - lint: shellcheck Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/lxc.sh')
-rwxr-xr-xutils/lxc.sh21
1 files changed, 8 insertions, 13 deletions
diff --git a/utils/lxc.sh b/utils/lxc.sh
index ce306fe85..a324bdaf2 100755
--- a/utils/lxc.sh
+++ b/utils/lxc.sh
@@ -112,14 +112,7 @@ EOF
}
usage_containers() {
- cat <<EOF
-LXC suite: ${LXC_SUITE_NAME}
-$(echo " ${LXC_SUITE_INSTALL_INFO}" | $FMT)
-suite images:
-$(echo " ${LOCAL_IMAGES[*]}" | $FMT)
-suite containers:
-$(echo " ${CONTAINERS[*]}" | $FMT)
-EOF
+ lxc_suite_install_info
[ -n "${1+x}" ] && err_msg "$1"
}
@@ -172,7 +165,7 @@ main() {
''|--|containers) remove_containers ;;
images) lxc_delete_images_localy ;;
${LXC_HOST_PREFIX}-*)
- ! lxc_exists "$2" && usage_containers "unknown container: $2" && exit 42
+ ! lxc_exists "$2" && warn_msg "container not yet exists: $2" && exit 0
if ask_yn "Do you really want to delete container $2"; then
lxc_delete_container "$2"
fi
@@ -201,7 +194,7 @@ main() {
lxc exec -t "$3" -- "${LXC_REPO_ROOT}/utils/lxc.sh" __show suite \
| prefix_stdout "[${_BBlue}$3${_creset}] "
;;
- *|--) show_suite;;
+ *) show_suite;;
esac
;;
images) show_images ;;
@@ -211,7 +204,7 @@ main() {
! lxc_exists "$3" && usage_containers "unknown container: $3" && exit 42
lxc config show "$3" | prefix_stdout "[${_BBlue}${3}${_creset}] "
;;
- *|--)
+ *)
rst_title "container configurations"
echo
lxc list "$LXC_HOST_PREFIX-"
@@ -226,7 +219,7 @@ main() {
! lxc_exists "$3" && usage_containers "unknown container: $3" && exit 42
lxc info "$3" | prefix_stdout "[${_BBlue}${3}${_creset}] "
;;
- *|--)
+ *)
rst_title "container info"
echo
lxc_cmd info
@@ -350,7 +343,9 @@ remove_containers() {
echo
lxc list "$LXC_HOST_PREFIX-"
echo -en "\\n${_BRed}LXC containers to delete::${_creset}\\n\\n ${CONTAINERS[*]}\\n" | $FMT
- if ask_yn "Do you really want to delete these containers"; then
+ local default=Ny
+ [[ $FORCE_TIMEOUT = 0 ]] && default=Yn
+ if ask_yn "Do you really want to delete these containers" $default; then
for i in "${CONTAINERS[@]}"; do
lxc_delete_container "$i"
done