Skip to content

Instantly share code, notes, and snippets.

@abdulhadad
Created March 1, 2022 08:06
Show Gist options
  • Select an option

  • Save abdulhadad/773a5caf9bfa9d0e410c6f63ca745088 to your computer and use it in GitHub Desktop.

Select an option

Save abdulhadad/773a5caf9bfa9d0e410c6f63ca745088 to your computer and use it in GitHub Desktop.
macOS zscaler start stop
#!/bin/sh
# for admin user
if [[ "$EUID" != 0 ]]; then
sudo -k # next sudo, ask for password
if sudo true; then
echo "Password ok"
else
echo "Password error"
exit 1
fi
fi
echo "Starting zscaler"
sudo launchctl load -w /Library/LaunchDaemons/com.zscaler.tunnel.plist
sudo launchctl load -w /Library/LaunchDaemons/com.zscaler.service.plist
launchctl load -w /Library/LaunchAgents/com.zscaler.tray.plist
#!/bin/sh
# for admin user
if [[ "$EUID" != 0 ]]; then
sudo -k # next sudo, ask for password
if sudo true; then
echo "Password ok"
else
echo "Password error"
exit 1
fi
fi
echo "Stoping zscaler"
launchctl unload -w /Library/LaunchAgents/com.zscaler.tray.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.zscaler.service.plist
sudo launchctl unload -w /Library/LaunchDaemons/com.zscaler.tunnel.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment