1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/vaultwarden_ynh.git synced 2024-09-03 18:26:31 +02:00

improving

This commit is contained in:
yalh76 2022-09-07 19:52:15 +02:00
parent 12fe507ab3
commit e0a7c301a9

View file

@ -71,7 +71,7 @@ ynh_setup_source_docker() {
src_format=${src_format:-tar.gz} src_format=${src_format:-tar.gz}
src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]') src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]')
src_extract=${src_extract:-true} src_extract=${src_extract:-true}
if [[ "$src_filename" = "" && "$src_format" != "docker" ]]; then if [ "$src_filename" = "" ]; then
src_filename="${source_id}.${src_format}" src_filename="${source_id}.${src_format}"
fi fi
@ -83,8 +83,7 @@ ynh_setup_source_docker() {
if [ "$src_format" = "docker" ]; then if [ "$src_format" = "docker" ]; then
src_plateform="${src_plateform:-"linux/$YNH_ARCH"}" src_plateform="${src_plateform:-"linux/$YNH_ARCH"}"
else elif test -e "$local_src"; then
if test -e "$local_src"; then
cp $local_src $src_filename cp $local_src $src_filename
else else
[ -n "$src_url" ] || ynh_die "Couldn't parse SOURCE_URL from $src_file_path ?" [ -n "$src_url" ] || ynh_die "Couldn't parse SOURCE_URL from $src_file_path ?"
@ -96,8 +95,6 @@ ynh_setup_source_docker() {
# Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget) # Timeout option is here to enforce the timeout on dns query and tcp connect (c.f. man wget)
out=$(wget --tries 3 --no-dns-cache --timeout 900 --no-verbose --output-document=$src_filename $src_url 2>&1) \ out=$(wget --tries 3 --no-dns-cache --timeout 900 --no-verbose --output-document=$src_filename $src_url 2>&1) \
|| ynh_die --message="$out" || ynh_die --message="$out"
fi
# Check the control sum # Check the control sum
echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status \ echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status \
|| ynh_die --message="Corrupt source" || ynh_die --message="Corrupt source"