mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
12 lines
295 B
Bash
12 lines
295 B
Bash
#!/usr/bin/env bash
|
|
set -eu
|
|
: "${DIR_VAR_LIB:?DIR_VAR_LIB required}"
|
|
|
|
if grep -qF " ${DIR_VAR_LIB} " /proc/self/mountinfo; then
|
|
echo "STATE=mounted"
|
|
elif [ -d "${DIR_VAR_LIB}" ] && [ -n "$(ls -A "${DIR_VAR_LIB}" 2>/dev/null)" ]; then
|
|
echo "STATE=has-local-data"
|
|
else
|
|
echo "STATE=empty"
|
|
fi
|