Skip to content

Instantly share code, notes, and snippets.

@vaughany
Last active January 27, 2026 16:30
Show Gist options
  • Select an option

  • Save vaughany/7f9d69fdd911d73dcc46e280ae140cb7 to your computer and use it in GitHub Desktop.

Select an option

Save vaughany/7f9d69fdd911d73dcc46e280ae140cb7 to your computer and use it in GitHub Desktop.
Small script to kill the Pulse VPN service and UI, 'cos they seem to hang sometimes, for no reason.
#!/bin/bash
# Finds and kills the Pulse Secure VPN background service and UI.
if [[ $EUID -ne 0 ]]; then
echo -e "\e[1;41mThis script must be run as root.\e[0m"
exit 1
fi
IDS=$(ps -ax | grep -i 'pulse[ui|svc]' | tr -s ' ' | sed 's/^ *//g' | cut -d ' ' -f 1)
for ID in ${IDS[@]}; do
echo -n "Killing $ID... "
sudo kill -s 9 $ID
echo done.
done
sudo echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" | tee /etc/resolv.conf
@jcsgasche
Copy link
Copy Markdown

Thank you! Very useful

@ashirazi2
Copy link
Copy Markdown

probably meant
grep -Ei 'pulse(ui|svc)'

pulse[ui|svc] literally matches "pulse" followed by any single character within the square brackets.
still works though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment