- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 10:34 AM
I have a configuration profile that adds our VPN configuration. I then have a policy that kicks off this simple bash script.
open “/System/Library/CoreServices/Menu Extras/vpn.menu”
All this does is check the box for "Show VPN status in the menu bar"
This is the error that I'm getting.
Script result: The files /“/System/Library/CoreServices/Menu and /Extras/vpn.menu” do not exist.
When I run the command in the terminal it completes successfully.
Solved! Go to Solution.
- Labels:
-
Scripts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 11:03 AM
Did you really use “ (curly double quotes) instead of " (straight double quotes)? If so change them all to straight quotes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 11:01 AM
On my device I can't even run that command in terminal, I get "The files /Users/UserID/“/System/Library/CoreServices/Menu and /Users/UserID/Extras/vpn.menu” do not exist." I believe core services is a symbolic link directory, you will need to locate the original path.
lrwxr-xr-x 1 root wheel 90 Feb 2 11:19 coreservicesd -> ../Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Support/coreservicesd

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 11:03 AM
Did you really use “ (curly double quotes) instead of " (straight double quotes)? If so change them all to straight quotes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 01:00 PM
That was it. Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 01:03 PM
I write all of my scripts in BBEdit and sometimes in CodeRunner. I actually never gave this any thought... curly vs. straight quotes. I figured the style of the quotes was controlled by the font they're typed in.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 02-23-2024 12:00 PM
I think the problem is that you're trying to run something by command line that opens an app. Jamf Pro runs commands as root, which means you're trying to open the app as root. But root isn't logged in.
Add a couple lines to the beginning to get the current user. Then use sudo or su to run the open command as that user.
