Skip to content

Commit

Permalink
shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagom62 committed Jun 16, 2018
1 parent 23c599f commit 3953e6b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions snipeit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ install_snipeit () {
chown -R "$APP_USER":"$apache_group" "$APP_PATH"

echo "* Running composer."
# We specify the path to composer because CentOS lacks /usr/local/bin in $PATH when using sudo
run_as /usr/local/bin/composer install --no-dev --prefer-source --working-dir "$APP_PATH"

sudo chgrp -R "$apache_group" "$APP_PATH/vendor"
Expand Down Expand Up @@ -258,8 +259,10 @@ if [[ -f /etc/lsb-release || -f /etc/debian_version ]]; then
version="$(lsb_release -rs)"
codename="$(lsb_release -cs)"
elif [ -f /etc/os-release ]; then
distro="$(. /etc/os-release && echo $ID)"
version="$(. /etc/os-release && echo $VERSION_ID)"
# shellcheck disable=SC1091
distro="$(source /etc/os-release && echo "$ID")"
# shellcheck disable=SC1091
version="$(source /etc/os-release && echo "$VERSION_ID")"
#Order is important here. If /etc/os-release and /etc/centos-release exist, we're on centos 7.
#If only /etc/centos-release exist, we're on centos6(or earlier). Centos-release is less parsable,
#so lets assume that it's version 6 (Plus, who would be doing a new install of anything on centos5 at this point..)
Expand All @@ -271,14 +274,14 @@ else
distro="unsupported"
fi

echo "
echo '
_____ _ __________
/ ___/____ (_)___ ___ / _/_ __/
\__ \/ __ \/ / __ \/ _ \______ / / / /
___/ / / / / / /_/ / __/_____// / / /
/____/_/ /_/_/ .___/\___/ /___/ /_/
/_/
"
'

echo ""
echo " Welcome to Snipe-IT Inventory Installer for CentOS, Fedora, Debian and Ubuntu!"
Expand Down

0 comments on commit 3953e6b

Please sign in to comment.