mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #15426 from BenHall/15425-set-e-install-script-fix
Fix install.sh to handle non-zero exit codes when checking lsb_release
This commit is contained in:
commit
ba0eba6960
1 changed files with 4 additions and 1 deletions
|
@ -56,10 +56,13 @@ check_forked() {
|
|||
# Check for lsb_release command existence, it usually exists in forked distros
|
||||
if command_exists lsb_release; then
|
||||
# Check if the `-u` option is supported
|
||||
set +e
|
||||
lsb_release -a -u > /dev/null 2>&1
|
||||
lsb_release_exit_code=$?
|
||||
set -e
|
||||
|
||||
# Check if the command has exited successfully, it means we're in a forked distro
|
||||
if [ "$?" = "0" ]; then
|
||||
if [ "$lsb_release_exit_code" = "0" ]; then
|
||||
# Print info about current distro
|
||||
cat <<-EOF
|
||||
You're using '$lsb_dist' version '$dist_version'.
|
||||
|
|
Loading…
Reference in a new issue