Skip to content

Commit

Permalink
CBG-3783 don't output error if command doesn't exist by using variable (
Browse files Browse the repository at this point in the history
#6902)

* CBG-3783 don't output error if command doesn't exist by using variable

* use more idiomatic shell
  • Loading branch information
torcolvin authored Jun 20, 2024
1 parent b64d925 commit 6546862
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions service/sync_gateway_service_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ usage() {
}

ostype() {
lsb_release 2>&1 > /dev/null
if [ $? -eq 0 ]; then
if [ -x "$(command -v lsb_release)" ]; then
OS=$(lsb_release -si)
VER=$(lsb_release -sr)
elif [ -f /etc/os-release ]; then
Expand Down
3 changes: 1 addition & 2 deletions service/sync_gateway_service_uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ usage() {
}

ostype() {
lsb_release 2>&1 > /dev/null
if [ $? -eq 0 ]; then
if [ -x "$(command -v lsb_release)" ]; then
OS=$(lsb_release -si)
VER=$(lsb_release -sr)
elif [ -f /etc/os-release ]; then
Expand Down
3 changes: 1 addition & 2 deletions service/sync_gateway_service_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ usage() {
}

ostype() {
lsb_release 2>&1 > /dev/null
if [ $? -eq 0 ]; then
if [ -x "$(command -v lsb_release)" ]; then
OS=$(lsb_release -si)
VER=$(lsb_release -sr)
elif [ -f /etc/os-release ]; then
Expand Down

0 comments on commit 6546862

Please sign in to comment.