#!/usr/bin/env bash{# Function to check and report if a specific setting is locked and set to truecheck_setting(){grep-Psrilq"^\h*$1\h*=\h*true\b"/etc/dconf/db/local.d/locks/*2>/dev/null&&echo"- \"$3\" is locked and set to false"||echo"- \"$3\"is not locked or not set to false"}# Array of settings to checkdeclare-Asettings=(["autorun-never"]="org/gnome/desktop/media-handling")# Check GNOME Desktop Manager configurationsl_output=()l_output2=()forsettingin"${!settings[@]}";doresult=$(check_setting"$setting")l_output+=("$result")if[[$result==*"is not locked"*||$result==*"not set to true"*]];thenl_output2+=("$result")fidone# Report resultsif[${#l_output2[@]}-ne0];thenprintf'%s\n'"- Audit Result:"" ** FAIL **"printf'%s\n'"- Reason(s) for audit failure:"formsgin"${l_output2[@]}";doprintf'%s\n'"$msg"doneelseprintf'%s\n'"- Audit Result:"" ** PASS **"fi}