diff --git a/wireguard-install.sh b/wireguard-install.sh index 7c7bcd6..bcdad72 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -86,23 +86,23 @@ if [[ "$OS" = 'ubuntu' ]]; then add-apt-repository ppa:wireguard/wireguard apt-get update apt-get install "linux-headers-$(uname -r)" - apt-get install wireguard iptables resolvconf + apt-get install wireguard iptables resolvconf qrencode elif [[ "$OS" = 'debian' ]]; then echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable apt update apt-get install "linux-headers-$(uname -r)" - apt install wireguard iptables resolvconf + apt install wireguard iptables resolvconf qrencode elif [[ "$OS" = 'fedora' ]]; then dnf copr enable jdoss/wireguard - dnf install wireguard-dkms wireguard-tools iptables + dnf install wireguard-dkms wireguard-tools iptables qrencode elif [[ "$OS" = 'centos' ]]; then curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo yum install epel-release - yum install wireguard-dkms wireguard-tools iptables + yum install wireguard-dkms wireguard-tools iptables qrencode elif [[ "$OS" = 'arch' ]]; then pacman -S linux-headers - pacman -S wireguard-tools iptables wireguard-arch + pacman -S wireguard-tools iptables wireguard-arch qrencode fi # Make sure the directory exists (this does not seem the be the case on fedora) @@ -160,3 +160,7 @@ sysctl --system systemctl start "wg-quick@$SERVER_WG_NIC" systemctl enable "wg-quick@$SERVER_WG_NIC" + +echo "Here is your client config file as a QR Code:" + +qrencode -t ansiutf8 -l L < "$HOME/$SERVER_WG_NIC-client.conf"