Skip to content

Instantly share code, notes, and snippets.

@fnx4
Last active March 29, 2020 11:51
Show Gist options
  • Save fnx4/f26c8137f0af5aba1ebd18a65ced2b21 to your computer and use it in GitHub Desktop.
Save fnx4/f26c8137f0af5aba1ebd18a65ced2b21 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo find /etc/openvpn/ -name "*.conf" -type f -delete
for file in conf/*.ovpn; do
mv -f "$file" "$(basename "$file" .ovpn).conf" 2>/dev/null
done
sudo cp -r conf/* /etc/openvpn/
sudo cp auth/login /etc/openvpn/
sudo find /etc/openvpn -type f -exec sed -i 's/auth-user-pass/auth-user-pass login/g' {} \;
sudo rm -f /var/log/check-vpn-speeds.log
sudo touch /var/log/check-vpn-speeds.log
tail -f /var/log/check-vpn-speeds.log -n 0 | grep --line-buffered RESULT &
sudo ./check-vpn-speeds.sh > ./current-log.txt
sudo service openvpn stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment