Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Commit

Permalink
cleaning up shellcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wesyoung committed Feb 8, 2018
1 parent 7c6dc2c commit 82ac915
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -9,6 +9,6 @@ before_install:
- sudo apt-get install shellcheck

script:
- shellcheck easybutton.sh
- shellcheck ubuntu16/bootstrap.sh
- shellcheck centos7/bootstrap.sh
- shellcheck -x easybutton.sh
- shellcheck -x ubuntu16/bootstrap.sh
- shellcheck -x centos7/bootstrap.sh
2 changes: 1 addition & 1 deletion centos7/bootstrap.sh
Expand Up @@ -7,7 +7,7 @@ export CIF_GATHERER_GEO_FQDN=$CIF_GATHERER_GEO_FQDN
export CIF_HUNTER_ADVANCED=$CIF_HUNTER_ADVANCED
export RHEL=$RHEL

if [ ${RHEL} == '1' ]; then
if [ "${RHEL}" == '1' ]; then
subscription-manager repos --enable rhel-7-server-extras-rpms
else
yum -y install epel-release
Expand Down
22 changes: 11 additions & 11 deletions easybutton.sh
Expand Up @@ -2,17 +2,16 @@

set -e

if [ `whoami` != 'root' ]; then
if [ "$(whoami)" != 'root' ]; then
echo "must be run as root"
exit 1
fi

# Check for an Internet Connection as it is required during installation
HTTP_HOST=http://github.com
if [ -x /usr/bin/wget ]; then
if [ -x "$(which wget)" ]; then
echo "Checking for an Internet connection"
wget -q --tries=3 --timeout=10 --spider $HTTP_HOST
if [[ $? -eq 0 ]]; then
if [[ "$(wget -q --tries=3 --timeout=10 --spider $HTTP_HOST)" -eq 0 ]]; then
echo "$HTTP_HOST appears to be available via HTTP"
else
echo "$HTTP_HOST does not appear to be available via HTTP"
Expand All @@ -26,20 +25,21 @@ fi
# archive old versions
bash archive_old_versions.sh

ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')

if [ -f /etc/lsb-release ]; then
# shellcheck disable=SC1091
. /etc/lsb-release
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
OS=Debian # XXX or Ubuntu??
VER=$(cat /etc/debian_version)
elif [ -f /etc/centos-release ]; then
# shellcheck disable=SC1091
. /etc/os-release
OS=$NAME
VER=$VERSION_ID
elif [ -f /etc/redhat-release ]; then
# shellcheck disable=SC1091
. /etc/os-release
OS=$NAME
VER=$VERSION_ID
Expand All @@ -50,9 +50,9 @@ fi

case $OS in
"Ubuntu" )
if [ $VER == "14.04" ]; then
if [ "$VER" == "14.04" ]; then
echo "14.04 is no longer supported, switch to 16.04 LTS (Server)"
elif [ $VER == "16.04" ]; then
elif [ "$VER" == "16.04" ]; then
cd ubuntu16
bash bootstrap.sh
else
Expand All @@ -72,10 +72,10 @@ case $OS in
exit 1;;

"Red Hat Enterprise Linux Server" )
if [ $VER == '7.3' ]; then
if [ "$VER" == '7.3' ]; then
cd centos7
RHEL='1' bash bootstrap.sh
elif [ $VER == '7.4' ]; then
elif [ "$VER" == '7.4' ]; then
cd centos7
RHEL='1' bash bootstrap.sh
else
Expand All @@ -85,7 +85,7 @@ case $OS in
;;

"CentOS Linux" )
if [ $VER == '7' ]; then
if [ "$VER" == '7' ]; then
cd centos7
bash bootstrap.sh
else
Expand Down

0 comments on commit 82ac915

Please sign in to comment.