Skip to content

Commit

Permalink
Add "-H" to grep when generating the list of VMs to start even if the…
Browse files Browse the repository at this point in the history
…re is only one match. By default does not list filenames if there is only one match.

This allows the script to work when the only VM setup in chyves is setup with rcboot > 0.
  • Loading branch information
3add3287 committed Aug 28, 2016
1 parent 645a899 commit 6a7c8a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rc.d/chyves
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ __chyves_start()
sleep 8 # Sleeping for network to come up.
local _previous_stdout_level="$( /usr/local/sbin/chyves list global | grep stdout_level | awk '{ print $2 }' )"
/usr/local/sbin/chyves global set stdout_level=0
local _guestlist="$( grep -E '^rcboot=' /chyves/*/guests/*/.config/.cfg | awk 'BEGIN { FS = "=" } ; $2 > "0" { print $1" "$2 }' | sort -Vrk2 | cut -d'/' -f5 | tr '\n' ',' | sed 's/,$//g' )"
local _guestlist="$( grep -H -E '^rcboot=' /chyves/*/guests/*/.config/.cfg | awk 'BEGIN { FS = "=" } ; $2 > "0" { print $1" "$2 }' | sort -Vrk2 | cut -d'/' -f5 | tr '\n' ',' | sed 's/,$//g' )"
echo "Starting chyves guests ($_guestlist)..."
/usr/local/sbin/chyves $_guestlist start
echo "Guests starting, resuming host boot."
Expand Down

0 comments on commit 6a7c8a2

Please sign in to comment.