check_vbox_service.sh

Check Vbox service in Bash

0

Votes

#!/bin/sh
SERVICE='VBoxService'
FILE=`find /media -name 'VBoxLinuxAdditions.run'`

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
  echo "$SERVICE running."
else
  echo "$SERVICE is not running,"
  if [ -f $FILE ];
  then
    echo "Installing..."
    sudo $FILE
  else
    echo "Please Load Gueat Additions!"
    return 1
  fi
fi

echo sudo $FILE

Vote Here

You must earn at least 1 vote on your snippets to be allowed to vote

Terms Of Use

Privacy Policy

Featured snippets are MIT license

Gears & Masters

Advertise

DevOpsnipp.com © 2020

medium.png