File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -418,6 +418,17 @@ function check_low_memory_guard {
418418 fi
419419}
420420
421+ function check_hostname {
422+ HOST=$( hostname)
423+ if echo " ${HOST} " | grep -q " [A-Z]" 2> /dev/null
424+ then
425+ printf -- " \033[0;33mWARNING: \033[0m The hostname of this server is '${HOST} '.\n"
426+ printf -- " Having uppercase letters in the hostname may cause issues with RBAC.\n"
427+ printf -- " Consider changing the hostname to only have lowercase letters with:\n"
428+ printf -- " \n"
429+ printf -- " hostnamectl set-hostname $( echo ${HOST} | tr ' [:upper:]' ' [:lower:]' ) \n"
430+ fi
431+ }
421432
422433if [[ (${#@ } -ne 0) && (( "$* " == "-- help") || ("$* " == "- h")) ]]; then
423434 print_help
@@ -432,6 +443,7 @@ mkdir -p ${SNAP_DATA}/inspection-report
432443printf -- ' Inspecting system\n'
433444check_memory
434445check_low_memory_guard
446+ check_hostname
435447
436448printf -- ' Inspecting Certificates\n'
437449check_certificates
You can’t perform that action at this time.
0 commit comments