SECFILE=/etc/slossec.conf
[ -f "$SECFILE" ] && source ${SECFILE} 
if [[ $fips -eq 1 ]] ; then
    $DIALOG --backtitle "$BT" --title "FIPS" --infobox "Federal Information Processing Standards" $H1 $W1
    sleep $autoTO

    log "security:EnableFIPS:Remediating rule 998/999: 'SLOS-EnableFIPS'"

    # Correct the form of default kernel command line in GRUB
    if /usr/bin/grep -q '^GRUB_CMDLINE_LINUX=.*fips=.*"'  /etc/default/grub ; then
        # modify the GRUB command-line if an fips= arg already exists
        /usr/bin/sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)fips=[^[:space:]]*\(.*"\)/\1 fips=1 \2/'  /etc/default/grub
    else
        # no selinux=arg is present, append it
        /usr/bin/sed -i 's/\(^GRUB_CMDLINE_LINUX=".*\)"/\1 fips=1"/'  /etc/default/grub
    fi

    # Correct the form of kernel command line for each installed kernel in the bootloader
    /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
    export REBOOT=Y
    sed -i "s/fips=1/fips=0/g" $SECFILE 2>/dev/null
    show "SLOSSecurity: FIPS Setup Completed"
else
    log "SLOSSecurity: FIPS Setup not performed"
fi
