I would like to create a script to close google Chrome and then Re-open the program .
I have tried using :
pkill -a -i "Google Chrome"
#!/bin/bash
loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");'`
su -l $loggedInUser -c "open -a "Google Chrome""
This closes the application successfully but the re-opening portion is not working which is the second half of this script.
Any help is appreciated.