Change the way volumes are defined by user
This commit is contained in:
parent
6d670c93a5
commit
f7aebc691a
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
mounts.conf
|
mounts.conf.d/*
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source "$(dirname "$0")/mounts.conf"
|
|
||||||
|
|
||||||
echo "Copying Systemd units to system directory..."
|
echo "Copying Systemd units to system directory..."
|
||||||
for mount in $mounts; do
|
for f in $(dirname "$0")/mounts.conf.d/*.conf; do
|
||||||
|
if [ ! -e "$f" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
source $f
|
||||||
mountfile=$(echo ${mount[target]} | sed -e "s:/:-:g")
|
mountfile=$(echo ${mount[target]} | sed -e "s:/:-:g")
|
||||||
mountfile=${mountfile:1}.mount
|
mountfile=${mountfile:1}.mount
|
||||||
sudo cp $(dirname "$0")/template.mount /etc/systemd/system/$mountfile
|
sudo cp $(dirname "$0")/template.mount /etc/systemd/system/$mountfile
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copy this file as mounts.conf, and add your volumes.
|
# Copy this file in mounts.conf.d as <something>.conf, and add your volume settings.
|
||||||
|
# You may repeat this for all your mounts
|
||||||
|
|
||||||
declare -A mount1
|
declare -A mount
|
||||||
mount1[mapper]='' # As in /dev/mapper/<?>
|
mount[mapper]='' # As in /dev/mapper/<?>
|
||||||
mount1[target]='' # Mount point (absolute path)
|
mount[target]='' # Mount point (absolute path)
|
||||||
mount1[friendly]='' # Optional friendly name for unit file Description
|
mount[friendly]='' # Optional friendly name for unit file Description
|
||||||
mount1[autolock]=0 # Set to 1 to enable autolock
|
mount[autolock]=0 # Set to 1 to enable autolock
|
||||||
|
|
||||||
mounts=(
|
|
||||||
$mount1
|
|
||||||
#$mount2...
|
|
||||||
)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user