Compare commits
2 Commits
46eb1bedfd
...
1f02156318
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f02156318 | ||
|
|
3c27adb337 |
@ -28,29 +28,15 @@ installDockerRootless()
|
||||
echo "---- $menu_number. Installing slirp4netns."
|
||||
echo ""
|
||||
|
||||
# slirp4netns update and install
|
||||
if ! command -v slirp4netns &> /dev/null; then
|
||||
isNotice "slirp4netns is not installed. Installing..."
|
||||
# slirp4netns — ensure it's installed via apt (idempotent: installs if missing,
|
||||
# no-op if already present). We install from apt, so there's no point chasing the
|
||||
# GitHub-latest release.
|
||||
local result; result=$(runSystem apt-get install -y slirp4netns)
|
||||
checkSuccess "Installing slirp4netns"
|
||||
else
|
||||
isNotice "slirp4netns is already installed"
|
||||
# `slirp4netns --version` prints several lines (version, commit, libslirp,
|
||||
# SLIRP_CONFIG_VERSION_MAX); read only the first line and take the version field.
|
||||
installed_version=$(slirp4netns --version | head -n1 | awk '{print $3}')
|
||||
latest_version=$(curl -s https://api.github.com/repos/rootless-containers/slirp4netns/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||
latest_version=${latest_version#v} # GitHub tags are vX.Y.Z; strip the v to compare
|
||||
if [[ -n "$latest_version" && "$installed_version" != "$latest_version" ]]; then
|
||||
isNotice "slirp4netns version $installed_version is outdated."
|
||||
isNotice "Installing version $latest_version..."
|
||||
local result; result=$(runSystem apt-get update)
|
||||
checkSuccess "Updating apt packages"
|
||||
local result; result=$(runSystem apt-get install -y slirp4netns)
|
||||
checkSuccess "Installing slirp4netns"
|
||||
else
|
||||
isSuccessful "slirp4netns version $installed_version is up to date"
|
||||
fi
|
||||
fi
|
||||
# SLIRP_CONFIG_VERSION_MAX); read only the first line, field 3 is the number.
|
||||
installed_version=$(slirp4netns --version 2>/dev/null | head -n1 | awk '{print $3}')
|
||||
isSuccessful "slirp4netns ${installed_version:-installed} is ready"
|
||||
|
||||
if [[ $(lsb_release -rs) == "10" ]]; then
|
||||
((menu_number++))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user