Skip to content

Instantly share code, notes, and snippets.

@LordNoteworthy
Created September 28, 2019 22:45
Show Gist options
  • Save LordNoteworthy/b93fb3a9c00bdbe540257a4b2081d8bf to your computer and use it in GitHub Desktop.
Save LordNoteworthy/b93fb3a9c00bdbe540257a4b2081d8bf to your computer and use it in GitHub Desktop.
restart-vmware
#!/bin/bash
processString=$(ps -ef | grep '[0-9][0-9]:[0-9][0-9]:[0-9][0-9] /usr/bin/vmtoolsd -n vmusr') # get proc$
tokens=( $processString ) # tokenize
kill "${tokens[1]}" # grab pid and kill it
/usr/bin/vmtoolsd -n vmusr & > /dev/null 2>&1 # restart vmtoolsd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment