X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=demohost-mount;h=706a516540d6d9f4b39946fb195229d4c08463b3;hb=32a1673064cfd9eaa165b4ea62fa416f02f3dfd2;hp=416ab2ea80042cdbbdc68cc0cacae1f184f8e24a;hpb=a5ab31675fd4b19fb5dcd32987c3323f0686fed0;p=distro-setup
diff --git a/demohost-mount b/demohost-mount
index 416ab2e..706a516 100755
--- a/demohost-mount
+++ b/demohost-mount
@@ -1,40 +1,32 @@
-#!/bin/bash
+#!/bin/bash -l
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
-[[ $EUID == 0 ]] || exec sudo -E "$BASH_SOURCE" "$@"
+[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
-virsh destroy demohost ||:
-# there's some other ways to configure it, but by default, we get perms of this user
-usermod -a -G ian libvirt-qemu
-usermod -a -G traci libvirt-qemu
-virsh attach-device demohost <(e " ") --config ||:
-virsh attach-device demohost <(e " ") --config ||:
+ip=$(host demohost | sed -rn 's/^\S+ has address //p;T;q')/32
+cedit demohost /etc/exports <>/etc/modules <>/etc/fstab <<'EOF'
-/a /a 9p trans=virtio 0 0
-/q /q 9p trans=virtio 0 0
+faiserver:/a /a nfs defaults 0 0
+faiserver:/q /q nfs defaults 0 0
/q/p /p none bind 0 0
EOF
+
mkdir -p /a /q /p
mount /a
mount /q