Compare commits
No commits in common. "f7aebc691a8de02e107783c9644acd0aa594b22f" and "f46c60ac84659a9cc6c240b7224141325dc74d9e" have entirely different histories.
f7aebc691a
...
f46c60ac84
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1 @@
|
|||||||
mounts.conf.d/*
|
mounts.conf
|
||||||
|
|
||||||
|
10
install.sh
10
install.sh
@ -1,11 +1,9 @@
|
|||||||
#!/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 f in $(dirname "$0")/mounts.conf.d/*.conf; do
|
for mount in $mounts; 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
|
||||||
@ -16,7 +14,7 @@ for f in $(dirname "$0")/mounts.conf.d/*.conf; do
|
|||||||
else
|
else
|
||||||
sudo sed -i -e "s/PH_FRIENDLY/${mount[mapper]}/g" /etc/systemd/system/$mountfile
|
sudo sed -i -e "s/PH_FRIENDLY/${mount[mapper]}/g" /etc/systemd/system/$mountfile
|
||||||
fi
|
fi
|
||||||
if [ ${mount[autolock]} -eq 1 ]; then
|
if [ ${mount[autlock]} -eq 1 ]; then
|
||||||
sudo cp $(dirname "$0")/close-vault.conf.template \
|
sudo cp $(dirname "$0")/close-vault.conf.template \
|
||||||
/etc/systemd/system/systemd-cryptsetup@${mount[mapper]}.service.d/close-vault.conf
|
/etc/systemd/system/systemd-cryptsetup@${mount[mapper]}.service.d/close-vault.conf
|
||||||
sudo sed -i -e "s/PH_MOUNTFILE/$mountfile/g" \
|
sudo sed -i -e "s/PH_MOUNTFILE/$mountfile/g" \
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Copy this file in mounts.conf.d as <something>.conf, and add your volume settings.
|
# Copy this file as mounts.conf, and add your volumes.
|
||||||
# You may repeat this for all your mounts
|
|
||||||
|
|
||||||
declare -A mount
|
declare -A mount1
|
||||||
mount[mapper]='' # As in /dev/mapper/<?>
|
mount1[mapper]='' # As in /dev/mapper/<?>
|
||||||
mount[target]='' # Mount point (absolute path)
|
mount1[target]='' # Mount point (absolute path)
|
||||||
mount[friendly]='' # Optional friendly name for unit file Description
|
mount1[friendly]='' # Optional friendly name for unit file Description
|
||||||
mount[autolock]=0 # Set to 1 to enable autolock
|
mount1[autolock]=0 # Set to 1 to enable autolock
|
||||||
|
|
||||||
|
mounts=(
|
||||||
|
$mount1
|
||||||
|
#$mount2...
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user