Files
2026-05-11 09:15:08 +02:00

19 lines
365 B
Bash

#!/usr/bin/env bash
directory="/dev/shm"
flag="noexec"
FSTAB_FILE="/etc/fstab"
if [[ ! -f "$FSTAB_FILE" ]]; then
echo "Error: $FSTAB_FILE does not exist."
exit 0
fi
if grep -q -E "^[^#]*[[:space:]]+$directory[[:space:]]+" "$FSTAB_FILE"; then
if grep -E "^[^#]*[[:space:]]+$directory[[:space:]]+" "$FSTAB_FILE" | grep -vq "$flag"; then
exit 1
fi
fi
exit 0