feat: check if user use unprivileged port 80

This commit is contained in:
Stephan Lüscher 2024-04-30 08:50:23 +00:00
parent d855d03eb9
commit c691ebaeac
No known key found for this signature in database
GPG key ID: 445779060FF3D3CF

View file

@ -125,6 +125,18 @@ function check_prerequisites {
echo -e "${GREEN}podman socket is ${PODMAN_SERVICE_STATUS}${ENDCOLOR}" echo -e "${GREEN}podman socket is ${PODMAN_SERVICE_STATUS}${ENDCOLOR}"
echo "" echo ""
fi fi
echo -e "${YELLOW}Checking net.ipv4.ip_unprivileged_port_start${ENDCOLOR}"
NET_IPV4_UNPRIV_PORT_START="$(sysctl -n net.ipv4.ip_unprivileged_port_start)"
if [ "${NET_IPV4_UNPRIV_PORT_START}" -gt 80 ];
then
echo -e "${RED}Your net.ipv4.ip_unprivileged_port_start is set to ${NET_IPV4_UNPRIV_PORT_START}${ENDCOLOR}"
echo -e "${RED}Make sure to configure net.ipv4.ip_unprivileged_port_start to <= 80${ENDCOLOR}"
echo -e "${YELLOW}Need help? -> run 'sudo sysctl net.ipv4.ip_unprivileged_port_start=80' for this session or run 'sudo sysctl -w net.ipv4.ip_unprivileged_port_start=80' for a permanent configuration${ENDCOLOR}"
exit 1
else
echo -e "${GREEN}net.ipv4.ip_unprivileged_port_start is ${NET_IPV4_UNPRIV_PORT_START}${ENDCOLOR}"
echo ""
fi
echo -e "${YELLOW}Checking jq installation${ENDCOLOR}" echo -e "${YELLOW}Checking jq installation${ENDCOLOR}"
JQ_PATH=$(which jq 2>/dev/null || echo 'FALSE') JQ_PATH=$(which jq 2>/dev/null || echo 'FALSE')
if [ "$JQ_PATH" == "FALSE" ]; if [ "$JQ_PATH" == "FALSE" ];