Created
October 8, 2023 11:28
-
-
Save fepitre/f2c29fafbcdd1ec781d8c61e8ebc3a6e to your computer and use it in GitHub Desktop.
qvm-create-bind-dir.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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