mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-24 13:50:16 +00:00
5d0cc9e072
Add support for Ubuntu Jammy (22.04) Add CI tests for Ubuntu Jammy Remove CI tests for Ubuntu Xenial Rename CI tests stages Add new CI Scripts to get pipeline code more "DRY" Update CI Scripts to exit on error with /bin/bash -e Add semantic-release settings Add CI Release step for PiVPN automated versioning
53 lines
951 B
Bash
53 lines
951 B
Bash
#!/bin/bash -e
|
|
|
|
# Tests multiple pivpn commands
|
|
|
|
testopenvpn() {
|
|
if command -v systemctl > /dev/null; then
|
|
systemctl status openvpn
|
|
elif command -v rc-service > /dev/null; then
|
|
rc-service openvpn status
|
|
fi
|
|
|
|
pivpn add -n foo nopass -d 180
|
|
pivpn add -p "$RANDOM$RANDOM" -n bar -d 180
|
|
pivpn add -o -n foo
|
|
pivpn -bk
|
|
sudo ls ~pi/pivpnbackup/ | grep backup
|
|
pivpn -l
|
|
pivpn -c
|
|
pivpn -r foo -y
|
|
exit 0
|
|
}
|
|
|
|
testwireguard() {
|
|
if command -v systemctl > /dev/null; then
|
|
systemctl status wg-quick@wg0
|
|
elif command -v rc-service > /dev/null; then
|
|
rc-service wg-quick status
|
|
fi
|
|
|
|
pivpn add -n foo
|
|
pivpn -qr foo
|
|
pivpn -bk
|
|
sudo ls ~pi/pivpnbackup/ | grep backup
|
|
pivpn -l
|
|
pivpn -c
|
|
pivpn -r foo -y
|
|
exit 0
|
|
}
|
|
|
|
while true; do
|
|
case "${1}" in
|
|
-o | --openvpn)
|
|
testopenvpn
|
|
;;
|
|
-w | --wireguard)
|
|
testwireguard
|
|
;;
|
|
*)
|
|
err "unknown VPN protocol"
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|