Chore: fix shellcheck
This commit is contained in:
6
vpn.bash
6
vpn.bash
@@ -12,14 +12,14 @@ resolved_conf_d=(
|
|||||||
function stopvpn() {
|
function stopvpn() {
|
||||||
mapfile -t vpn_pid <<< "$(pgrep openfortivpn) $(pgrep openvpn) $(pgrep openconnect)"
|
mapfile -t vpn_pid <<< "$(pgrep openfortivpn) $(pgrep openvpn) $(pgrep openconnect)"
|
||||||
|
|
||||||
for pid in ${vpn_pid[@]}; do
|
for pid in "${vpn_pid[@]}"; do
|
||||||
if [[ -n "$pid" ]]; then
|
if [[ -n "$pid" ]]; then
|
||||||
echo "Kill process $pid."
|
echo "Kill process $pid."
|
||||||
sudo kill "$pid"
|
sudo kill "$pid"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
for conf in ${resolved_conf_d[@]}; do
|
for conf in "${resolved_conf_d[@]}"; do
|
||||||
if [[ -e "/etc/systemd/resolved.conf.d/$conf" ]]; then
|
if [[ -e "/etc/systemd/resolved.conf.d/$conf" ]]; then
|
||||||
sudo rm "/etc/systemd/resolved.conf.d/$conf"
|
sudo rm "/etc/systemd/resolved.conf.d/$conf"
|
||||||
fi
|
fi
|
||||||
@@ -118,4 +118,4 @@ function main() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
main $@
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user