Skip to content

Commit

Permalink
Improved dos2unix calls
Browse files Browse the repository at this point in the history
now greps for any shell scripts featuring carriage returns, builds a list, passes to xargs to pass to dos2unix

Means that it doesn't run dos2unix unless it absolutely has to.
  • Loading branch information
WGAndrew authored Oct 27, 2016
1 parent 109fd5b commit 3f2a1ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions host/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ elif [ "${NETWORK_TAG}" != "${LOCAL_TAG}" -o "$2" == "force" ]; then
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; }
dos2unix *.sh
grep -lU $'\x0D' *.sh | xargs dos2unix
#ensure the cwhservice always is linux format and executable
dos2unix /etc/init.d/cwhservice
grep -lU $'\x0D' /etc/init.d/cwhservice | xargs dos2unix
chmod +x /etc/init.d/cwhservice
rm ${DL_FILE}
else
Expand Down

0 comments on commit 3f2a1ef

Please sign in to comment.