add tryAddMount
we try to add a mount. if it fails, it will revert to the previous mount config. there was a plan to make this work based on systemd-mount but we hit this bug - https://bugzilla.redhat.com/show_bug.cgi?id=1708996
This commit is contained in:
@@ -23,9 +23,11 @@ mount_file_contents="$1"
|
||||
where=$(echo "${mount_file_contents}" | grep "^Where=" | cut -d'=' -f 2)
|
||||
|
||||
mount_filename=$(systemd-escape -p --suffix=mount "$where")
|
||||
|
||||
echo "$mount_file_contents" > "/etc/systemd/system/${mount_filename}"
|
||||
mount_file="/etc/systemd/system/${mount_filename}"
|
||||
|
||||
systemctl stop "${mount_filename}" || true
|
||||
|
||||
echo "$mount_file_contents" > "${mount_file}"
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable --no-block --now "${mount_filename}" || true
|
||||
|
||||
Reference in New Issue
Block a user