20 lines
925 B
Bash
Executable file
20 lines
925 B
Bash
Executable file
#! /bin/sh -ex
|
|
|
|
# determine latest stable release (see https://launchpad.net/+apidoc)
|
|
# in most cases the current series is devel, except for right after a stable release
|
|
rel=$(curl --silent https://api.launchpad.net/devel/ubuntu/current_series_link | sed 's/^"//; s/"$//')
|
|
if ! curl --silent "$rel" | grep -q '"supported": true'; then
|
|
# not supported, go back
|
|
rel=$(curl --silent "$rel/previous_series_link" | sed 's/^"//; s/"$//')
|
|
|
|
if ! curl --silent "$rel" | grep -q '"supported": true'; then
|
|
echo "ERROR: neither of the last two releases are supported!?" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
# release name is the last part of the URL
|
|
rel=${rel##*/}
|
|
|
|
exec $(dirname $0)/lib/debian.bootstrap "$1" "$2" ubuntu-18.04 "deb http://archive.ubuntu.com/ubuntu $rel main universe
|
|
deb http://archive.ubuntu.com/ubuntu ${rel}-updates main universe
|
|
deb http://security.ubuntu.com/ubuntu ${rel}-security main universe"
|