mirror of
https://github.com/ublue-os/forge.git
synced 2025-04-18 20:43:43 +03:00
refactor: change order of pre-requisites checks
This commit is contained in:
parent
4698b47ed3
commit
8a8b396e8d
23
forge.sh
23
forge.sh
|
@ -91,17 +91,6 @@ function create_network {
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_prerequisites {
|
function check_prerequisites {
|
||||||
echo -e "${YELLOW}Checking sshd service${ENDCOLOR}"
|
|
||||||
SSH_SERVICE_STATUS="$(systemctl is-active sshd)"
|
|
||||||
if [ "${SSH_SERVICE_STATUS}" = "inactive" ];
|
|
||||||
then
|
|
||||||
echo -e "${RED}It looks like your sshd service is not running.${ENDCOLOR}"
|
|
||||||
echo -e "${RED}Make sure to configure and start it first.${ENDCOLOR}"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo -e "${GREEN}sshd service is ${SSH_SERVICE_STATUS}${ENDCOLOR}"
|
|
||||||
echo ""
|
|
||||||
fi
|
|
||||||
echo -e "${YELLOW}Checking podman installation${ENDCOLOR}"
|
echo -e "${YELLOW}Checking podman installation${ENDCOLOR}"
|
||||||
PODMAN_PATH=$(which podman 2>/dev/null || echo 'FALSE')
|
PODMAN_PATH=$(which podman 2>/dev/null || echo 'FALSE')
|
||||||
if [ "$PODMAN_PATH" == "FALSE" ];
|
if [ "$PODMAN_PATH" == "FALSE" ];
|
||||||
|
@ -149,6 +138,18 @@ function check_prerequisites {
|
||||||
echo -e "${GREEN}jq is installed${ENDCOLOR}"
|
echo -e "${GREEN}jq is installed${ENDCOLOR}"
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
echo -e "${YELLOW}Checking sshd service${ENDCOLOR}"
|
||||||
|
SSH_SERVICE_STATUS="$(systemctl is-active sshd)"
|
||||||
|
if [ "${SSH_SERVICE_STATUS}" != "active" ];
|
||||||
|
then
|
||||||
|
echo -e "${RED}It looks like your sshd service is not running.${ENDCOLOR}"
|
||||||
|
echo -e "${RED}Make sure to configure and start it first.${ENDCOLOR}"
|
||||||
|
echo -e "${YELLOW}Need help? -> https://docs.fedoraproject.org/en-US/fedora/latest/system-administrators-guide/infrastructure-services/OpenSSH/#s2-ssh-configuration-sshd${ENDCOLOR}"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}sshd service is ${SSH_SERVICE_STATUS}${ENDCOLOR}"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_info {
|
function show_info {
|
||||||
|
|
Loading…
Reference in a new issue