pivpn/ciscripts/test.sh
4s3ti 5d0cc9e072 feat(ossupport): Jammy Support & CI Updates
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
2022-08-17 22:11:48 +02:00

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