Files
cis/script/check/host/checks/system_hostname_is_long.check.sh
2025-03-08 09:33:35 +01:00

11 lines
234 B
Bash
Executable File

#!/bin/bash
_CURRENT_FILE='/etc/hostname'
#The file must be readable, then
#the number of lines containing a '.' must be zero.
[ -r "${_CURRENT_FILE}" ] \
&& [ "$(grep -cF '.' "${_CURRENT_FILE}")" -gt 0 ] \
&& exit 0
exit 1