# generated instead of dynamic for the benefit of shellcheck
#for x in /a/bin/distro-functions/src/* /a/bin/!(githtml)/*-function?(s); do echo source $x ; done
source /a/bin/distro-functions/src/identify-distros
-source /a/bin/distro-functions/src/package-manager-abstractions
source /a/bin/log-quiet/logq-function
# for x in /a/bin/bash_unpublished/source-!(.#*); do echo source $x; done
source /a/bin/bash_unpublished/source-semi-priv
local host ipsuf umask_orig
host=$1
ipsuf=$2
- mkdir -p /p/c/machine_specific/$host/filesystem/etc/{wireguard,network/interfaces.d}
+ mkdir -p /p/c/machine_specific/$host/filesystem/etc/wireguard
cd /p/c/machine_specific/$host/filesystem/etc/wireguard
umask_orig=$(umask)
umask 0077
- wg genkey | tee $host-priv.key | wg pubkey > $host-pub.key
+ wg genkey | tee hole-priv.key | wg pubkey > hole-pub.key
cat >wghole.conf <<EOF
[Interface]
# contents hole-priv.key
sudo chown $USER:$USER /mnt/$base
else
base=$1
- sudo umount /mnt/$base
+ if mountpoint /mnt/$base &>/dev/null; then
+ sudo umount /mnt/$base
+ fi
l=$(sudo cryptsetup status /dev/mapper/$base|sed -rn 's/^\s*device:\s*(.*)/\1/p')
sudo cryptsetup luksClose /dev/mapper/$base || return 1
sudo losetup -d $l
sudo systemctl stop $vpn_service@$1
}
vpnoffc() { # vpn off client
- ser stop openvpn-nn@client
+ ser stop openvpn-client-tr@client
}
vpnc() {
- ser start openvpn-nn@client
+ ser start openvpn-client-tr@client
}