2021-08-15 21:48:06 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2024-01-08 17:50:43 +01:00
|
|
|
#REMOVEME? pkg_dependencies="postgresql postgresql-contrib"
|
2021-08-15 21:48:06 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-15 22:53:56 +01:00
|
|
|
# custom function to detect armv6 and armv7
|
|
|
|
# ($YNH_ARCH returns armhf for both...)
|
2022-03-15 22:50:47 +01:00
|
|
|
detect_arch(){
|
2022-03-15 22:47:43 +01:00
|
|
|
local architecture
|
2023-10-23 17:07:44 +02:00
|
|
|
if uname -m | grep -q -E "arm64|aarch64" ; then
|
2022-03-15 22:47:43 +01:00
|
|
|
architecture="arm64"
|
2023-10-17 22:22:18 +02:00
|
|
|
elif uname -m | grep -q "64" ; then
|
2022-03-15 22:47:43 +01:00
|
|
|
architecture="x86-64"
|
2023-10-17 22:22:18 +02:00
|
|
|
elif uname -m | grep -q "86" ; then
|
2022-03-15 22:47:43 +01:00
|
|
|
architecture="i386"
|
2023-10-17 22:22:18 +02:00
|
|
|
elif uname -m | grep -q "armv6" ; then
|
2022-03-15 22:47:43 +01:00
|
|
|
architecture="armv6"
|
2023-10-17 22:22:18 +02:00
|
|
|
elif uname -m | grep -q "armv7" ; then
|
2022-03-15 22:47:43 +01:00
|
|
|
architecture="armv7"
|
|
|
|
else
|
|
|
|
architecture="unknown"
|
|
|
|
fi
|
|
|
|
echo $architecture
|
|
|
|
}
|
|
|
|
|
2022-03-26 04:56:16 +01:00
|
|
|
# custom function to change bash bool 0/1 to false/true
|
|
|
|
convert_bool(){
|
2022-03-26 05:35:44 +01:00
|
|
|
(("$1")) && echo "true" || echo "false"
|
2022-03-26 04:56:16 +01:00
|
|
|
}
|
|
|
|
|
2021-08-15 21:48:06 +02:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|