misc fixes and improvements
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 1e2f999d72d7728da9c185c1372386a715738f4d..6f0d016b935c58b2dd6a4605097317ca893fd6dc 100644 (file)
--- a/brc2
+++ b/brc2
@@ -35,7 +35,6 @@ esac
 # 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
@@ -1019,11 +1018,11 @@ wghole() {
   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
@@ -1071,7 +1070,9 @@ lom() {
     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
@@ -1703,10 +1704,10 @@ vpnoff() {
   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
 }