Skip to content

Commit

Permalink
Merge pull request #276 from WGAndrew/patch-1
Browse files Browse the repository at this point in the history
minor improvements to start.sh
  • Loading branch information
WesGilster authored Oct 27, 2016
2 parents 1f6fdb2 + 3f2a1ef commit cef98cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions host/bin/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

if [[ $UID != 0 ]]; then
echo "Please run this script with sudo:"
echo "sudo $0 $*"
exit 1
fi

cpu=`uname -m`

if [ -z "$HOME" ] || [ "$HOME" == "/" ]; then
Expand Down Expand Up @@ -142,6 +148,12 @@ elif [ "${NETWORK_TAG}" != "${LOCAL_TAG}" -o "$2" == "force" ]; then

unzip ${DL_FILE}
chmod 777 *.sh
#grab dos2unix from the package manager if not installed
command -v dos2unix >/dev/null 2>&1 || { apt-get install --yes --force-yes dos2unix >&2; }
grep -lU $'\x0D' *.sh | xargs dos2unix
#ensure the cwhservice always is linux format and executable
grep -lU $'\x0D' /etc/init.d/cwhservice | xargs dos2unix
chmod +x /etc/init.d/cwhservice
rm ${DL_FILE}
else
echo No install required
Expand Down

0 comments on commit cef98cc

Please sign in to comment.