Chore: fix shellcheck

This commit is contained in:
2026-01-19 15:42:20 +08:00
parent 7cb0dac6b1
commit dc1cb0fab1

View File

@@ -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 "$@"