mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
[mod] use 'awk' instead of 'cut' to split line.
This commit is contained in:
parent
20fd7daa7e
commit
d8a5e5ec53
1 changed files with 2 additions and 2 deletions
4
ynh-dev
4
ynh-dev
|
@ -151,9 +151,9 @@ elif [ "$1" = "run" ]; then
|
||||||
#####################
|
#####################
|
||||||
elif [ "$1" = "halt" ]; then
|
elif [ "$1" = "halt" ]; then
|
||||||
vm=$(vagrant global-status | head -3 | tail -1)
|
vm=$(vagrant global-status | head -3 | tail -1)
|
||||||
vm_status=$(echo $vm | cut -d ' ' -f 4)
|
vm_status=$(echo $vm | awk -F '[[:space:]]' '{print $4}')
|
||||||
if [ $vm_status == "running" ]; then
|
if [ $vm_status == "running" ]; then
|
||||||
vm_id=$(echo $vm | cut -d ' ' -f 1)
|
vm_id=$(echo $vm | awk -F '[[:space:]]' '{print $1}')
|
||||||
vagrant halt $vm_id
|
vagrant halt $vm_id
|
||||||
echo "–> VM turned off."
|
echo "–> VM turned off."
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue