Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Fix some errors in FreeBSD 13 #229

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/usr/sbin/one-contextd
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function get_new_context {
blkid | grep "LABEL=['\"]CONTEXT['\"]" | cut -d: -f1;
} | grep -v '^/dev/loop' | head -n1
)
elif [[ "$distro" == "BSD" ]]; then
elif [[ "$distro" == "BSD" ]] && [[ $(glabel status | grep CONTEXT) ]]; then
local dev_context="/dev/"$(glabel status | grep CONTEXT | awk '{print $3}')
fi

Expand Down Expand Up @@ -290,7 +290,7 @@ function acquire_lock {

function cleanup {
# unmount context
if [ -d "${MOUNT_DIR}" ]; then
if [ -d "${MOUNT_DIR}" ] && [ -n "$(mount | grep ${MOUNT_DIR})" ]; then
log debug "Unmounting ${MOUNT_DIR}"
if [[ "$distro" == "Linux" ]]; then
umount -l "${MOUNT_DIR}"
Expand Down