On 11/09/2025 11:23, Kevin Chadwick via Dng wrote:
> The script (I put it into a new gist as the original is missing) appears to
> already have a provision for overriding the name:
>
> if [ -n "$1" ]; then
> UPSTREAM_CODENAME="$1"
> else
> if [ -e /etc/os-release ]; then
> ...
>
> Therefore, you can simply run it as:
>
> curl -s https://repo.waydro.id/ | sudo bash -s -- bookworm
The full script follows which uses space/tab matching via cut. I assume there is
a spec for that. As Devuan is mostly Debian I wonder if it would be better or
problematic to add an extra line or field somewhere to indicate a Daedalus
variation etc. and just provide Bookworm as -f2. Might be easier than garnering
support in downstream projects?
if [ -n "$1" ]; then
UPSTREAM_CODENAME="$1"
else
if [ -e /etc/os-release ]; then
OS_RELEASE=/etc/os-release
elif [ -e /usr/lib/os-release ]; then
OS_RELEASE=/usr/lib/os-release
fi
UPSTREAM_CODENAME=$(grep "^UBUNTU_CODENAME=" ${OS_RELEASE} | cut -d'=' -f2)
if [ -z "${UPSTREAM_CODENAME}" ]; then
UPSTREAM_CODENAME=$(grep "^DEBIAN_CODENAME=" ${OS_RELEASE} | cut -d'=' -f2)
fi
if [ -z "${UPSTREAM_CODENAME}" ]; then
UPSTREAM_CODENAME=$(grep "^VERSION_CODENAME=" ${OS_RELEASE} | cut -d'=' -f2)
fi
# Debian 12+
if [ -z "${UPSTREAM_CODENAME}" ] && [ -e /etc/debian_version ]; then
UPSTREAM_CODENAME=$(cut -d / -f 1 /etc/debian_version)
fi
if [ -z "${UPSTREAM_CODENAME}" ]; then
echo "[!] Could not detect your distribution. Please provide a valid
option as first argument"
exit 1
fi
fi