minor improvements
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 1e2f999d72d7728da9c185c1372386a715738f4d..6effa21c788e939e514c7a1c17887bae135c9bea 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
@@ -1287,7 +1288,7 @@ pumpa() {
   # other tiling window managers in giving up on setting it at all
   #
   xprop -root -remove _NET_WORKAREA
-  command pumpa &r
+  command pumpa & r
 }
 
 # reviewboard, used at my old job
@@ -1490,7 +1491,7 @@ tm() {
   (sleep $(calc "$* * 60") && mpv --no-config --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 &
 }
 
-trg() { transmission-remote-gtk&r; }
+trg() { transmission-remote-gtk & r; }
 trc() {
   # example, set global upload limit to 100 kilobytes:
   # trc -u 100
@@ -1584,10 +1585,10 @@ vpncmd() {
   m sudo -E env "PATH=$PATH" nsenter -t $(pgrep -f "/usr/sbin/openvpn .* --config /etc/openvpn/.*client.conf") -n -m "$@"
 }
 vpnf() {
-  vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn &r
+  vpncmd sudo -E -u iank env "PATH=$PATH" abrowser -no-remote -P vpn & r
 }
 vpn2f() {
-  vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 &r
+  vpncmd sudo -u iank env "PATH=$PATH" abrowser -no-remote -P vpn2 & r
 }
 
 vpni() {
@@ -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
 }