2021-05-10 05:35:07 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
case ${DIB_GROWVOLS_TRIGGER} in
|
|
|
|
manual) echo "growvols triggered manually after boot"; exit ;;
|
|
|
|
systemd) echo "growvols triggered by systemd" ;;
|
|
|
|
*) echo "Unsupported DIB_GROWVOLS_TRIGGER: ${DIB_GROWVOLS_TRIGGER}"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
2022-02-03 21:23:13 +00:00
|
|
|
cat << EOF | sudo tee /etc/default/growvols > /dev/null
|
2021-05-10 05:35:07 +00:00
|
|
|
GROWVOLS_ARGS="${DIB_GROWVOLS_ARGS}"
|
|
|
|
GROWVOLS_GROUP="${DIB_GROWVOLS_GROUP}"
|
|
|
|
GROWVOLS_DEVICE="${DIB_GROWVOLS_DEVICE}"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
case "$DIB_INIT_SYSTEM" in
|
|
|
|
systemd)
|
|
|
|
systemctl enable growvols.service
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported init system"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|