Skip to content

Instantly share code, notes, and snippets.

@fepitre
Created October 8, 2023 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fepitre/f2c29fafbcdd1ec781d8c61e8ebc3a6e to your computer and use it in GitHub Desktop.
Save fepitre/f2c29fafbcdd1ec781d8c61e8ebc3a6e to your computer and use it in GitHub Desktop.
qvm-create-bind-dir.sh
#!/bin/bash
set -eu
if [ "${DEBUG:-0}" == "1" ]; then
set -x
fi
bind_dir="$(readlink -f "$1")"
bind_name="$(basename "${bind_dir}")"
if [ ! -d "${bind_dir}" ]; then
echo "ERROR: cannot find directory '${bind_dir}'."
fi
mkdir -p /rw/config/qubes-bind-dirs.d
if ! grep -q -R "${bind_dir}" /rw/config/qubes-bind-dirs.d/; then
mkdir -p "/rw/bind-dirs/${bind_dir}"
echo "binds+=('${bind_dir}')" > "/rw/config/qubes-bind-dirs.d/${bind_name}.conf"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment