A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
52 lines
1.6 KiB
Bash
Executable File
52 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
detectOS() {
|
|
if [ -f /etc/os-release ]; then
|
|
source /etc/os-release
|
|
OS_TYPE=""
|
|
OS_VERSION="$VERSION_ID"
|
|
|
|
# Check main ID and ID_LIKE to catch derivatives like Pop!_OS
|
|
case "$ID" in
|
|
debian)
|
|
OS_TYPE="Debian"
|
|
;;
|
|
ubuntu | pop)
|
|
OS_TYPE="Ubuntu"
|
|
;;
|
|
arch)
|
|
OS_TYPE="Arch"
|
|
;;
|
|
*)
|
|
if [[ "$ID_LIKE" =~ "debian" ]]; then
|
|
OS_TYPE="Debian"
|
|
elif [[ "$ID_LIKE" =~ "ubuntu" ]]; then
|
|
OS_TYPE="Ubuntu"
|
|
else
|
|
isError "Unsupported OS detected."
|
|
exit 1
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
isNotice "Detected OS: $OS_TYPE $OS_VERSION"
|
|
|
|
# Check if this is a tested/supported version
|
|
if [[ ("$OS_TYPE" == "Debian" && ! "$OS_VERSION" =~ ^(10|11|12|13)$) ||
|
|
("$OS_TYPE" == "Ubuntu" && ! "$OS_VERSION" =~ ^(18.04|20.04|22.04)$) ]]; then
|
|
isNotice "This OS version ($OS_VERSION) is untested and may not be fully supported."
|
|
while true; do
|
|
read -rp "Do you wish to continue anyway? (y/n): " oswarningaccept
|
|
case "$oswarningaccept" in
|
|
[Yy]) break ;;
|
|
[Nn]) exit 1 ;;
|
|
*) isNotice "Invalid input. Please enter y or n." ;;
|
|
esac
|
|
done
|
|
fi
|
|
else
|
|
isError "Unable to detect OS."
|
|
exit 1
|
|
fi
|
|
}
|