#!/bin/bash

_install() {
    if [[ $OS == "CentOS7" ]];then
        sed -i 's/#HandlePowerKey=poweroff/HandlePowerKey=ignore/' /etc/systemd/logind.conf
        systemctl restart systemd-logind
    fi
}

_check() {
    _check="PASS"

    if [[ $OS == "CentOS7" ]];then
        grep -q 'HandlePowerKey=ignore' /etc/systemd/logind.conf
        if [[ $? -ne 0 ]];then
            _check="FAIL"
            PRINT_ERR "[ERROR] PowerKey is not disabled"
        fi
    fi
}
