setup update scripts
Signed-off-by: philippe lhardy <philippe.lhardy@astrolabe.coop>
This commit is contained in:
@@ -4,6 +4,8 @@ source lib/metascript.sh
|
||||
|
||||
enforcedir polls exists
|
||||
|
||||
log_warn "No check is done to verify if container is already started"
|
||||
|
||||
defaultmetainit $@
|
||||
|
||||
podman=podman
|
||||
@@ -14,14 +16,21 @@ container_name=$nextcloud_image
|
||||
rel_bind_folder=bind_folder
|
||||
bind_folder=$(pwd)/$rel_bind_folder
|
||||
|
||||
#lazzy detection base on first local ip
|
||||
declare -a possible_hosts=($(ip a | grep 192.168.1 |awk '{ gsub("/24","",$2); print $2 ; }'))
|
||||
hosts_n=${#possible_hosts[@]}
|
||||
if (( hosts_n > 1 ))
|
||||
then
|
||||
log_warn "multiple hosts $hosts_n"
|
||||
fi
|
||||
listen_host=${possible_hosts[0]}
|
||||
# if wanting to expose nextcloud on host address
|
||||
detect_expose_address()
|
||||
{
|
||||
#lazzy detection base on first local ip
|
||||
declare -a possible_hosts=($(ip a | grep 192.168.1 |awk '{ gsub("/24","",$2); print $2 ; }'))
|
||||
hosts_n=${#possible_hosts[@]}
|
||||
if (( hosts_n > 1 ))
|
||||
then
|
||||
log_warn "multiple hosts $hosts_n"
|
||||
fi
|
||||
listen_host=${possible_hosts[0]}
|
||||
}
|
||||
|
||||
# detect_expose_address
|
||||
listen_host=127.0.0.1
|
||||
log_info "liston on $listen_host"
|
||||
|
||||
declare -a podman_args
|
||||
@@ -70,6 +79,12 @@ done
|
||||
# with root ...
|
||||
podman_args+=(--mount type=bind,source=$(pwd)/polls,target=/root/polls)
|
||||
|
||||
# network bridge slirp4netns (not pasta) and allow_host_loopback)
|
||||
# podman_args+=(--network=slirp4netns:allow_host_loopback=true)
|
||||
|
||||
# pasta
|
||||
podman_args+=(--network=pasta:--map-host-loopback=10.1.1.13)
|
||||
|
||||
if [[ -n $detach ]]
|
||||
then
|
||||
podman_args+=(-d)
|
||||
@@ -83,7 +98,7 @@ then
|
||||
|
||||
sudo cp $config_php config.php
|
||||
sudo chown $(id -u):$(id -g) config.php
|
||||
php patch_config.php "$listen_host:$host_free_port" | sudo tee ${bind_folder}/config/config.php
|
||||
php patch_config.php "$listen_host:$host_free_port" | sudo tee ${bind_folder}/config/config.php >/dev/null
|
||||
else
|
||||
log_info "no config/php, first install ?"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user