2018-09-27 22:44:34 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-04-05 12:29:32 +02:00
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2020-11-01 16:00:22 +01:00
|
|
|
YNH_PHP_VERSION="7.3"
|
|
|
|
# dependencies used by the app
|
|
|
|
# dependencies used by the app
|
|
|
|
pkg_dependencies=""
|
|
|
|
|
|
|
|
extra_php_dependencies="php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gettext php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mbstring openssl"
|
2019-04-05 12:29:32 +02:00
|
|
|
|
2017-06-17 12:20:09 +02:00
|
|
|
|
2018-09-27 22:44:34 +02:00
|
|
|
#=================================================
|
2020-11-01 16:00:22 +01:00
|
|
|
# PERSONAL HELPERS
|
2018-09-27 22:44:34 +02:00
|
|
|
#=================================================
|
|
|
|
|
2020-11-01 16:00:22 +01:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
2019-04-05 12:29:32 +02:00
|
|
|
|
2020-11-01 16:00:22 +01:00
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
# Check if there's enough free space in a directory
|
2019-04-05 12:29:32 +02:00
|
|
|
is_there_enough_space () {
|
|
|
|
local free_space=$(df --output=avail "$1" | sed 1d)
|
|
|
|
test $free_space -ge $min_size
|
|
|
|
}
|
|
|
|
|
|
|
|
if is_there_enough_space /tmp; then
|
|
|
|
local tmpdir=/tmp
|
|
|
|
elif is_there_enough_space /var; then
|
|
|
|
local tmpdir=/var
|
|
|
|
elif is_there_enough_space /; then
|
2020-11-01 16:00:22 +01:00
|
|
|
local tmpdir=/
|
2019-04-05 12:29:32 +02:00
|
|
|
elif is_there_enough_space /home; then
|
|
|
|
local tmpdir=/home
|
|
|
|
else
|
|
|
|
ynh_die "Insufficient free space to continue..."
|
|
|
|
fi
|
|
|
|
|
2020-03-31 06:21:55 +02:00
|
|
|
echo "$(mktemp --directory --tmpdir="$tmpdir")"
|
2019-04-05 12:29:32 +02:00
|
|
|
}
|