Skip to content

Instantly share code, notes, and snippets.

@vaughany
Last active April 26, 2024 13:24
Show Gist options
  • Save vaughany/7f9d69fdd911d73dcc46e280ae140cb7 to your computer and use it in GitHub Desktop.
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

Thank you! Very useful

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