Merge pull request 'Add Check Point Gaia (FW1) management and firewall appliances to explorers' (#339) from stephan/cdist:master into master

Reviewed-on: #339
This commit is contained in:
nico14571 2022-07-29 08:56:09 +00:00
commit 7de931829a
7 changed files with 26 additions and 0 deletions

View file

@ -21,6 +21,9 @@
set +e set +e
case "$("$__explorer/os")" in case "$("$__explorer/os")" in
checkpoint)
awk '{printf("%s\n", $(NF-1))}' /etc/cp-release
;;
openwrt) openwrt)
# shellcheck disable=SC1091 # shellcheck disable=SC1091
(. /etc/openwrt_release && echo "$DISTRIB_CODENAME") (. /etc/openwrt_release && echo "$DISTRIB_CODENAME")

View file

@ -21,6 +21,9 @@
set +e set +e
case "$("$__explorer/os")" in case "$("$__explorer/os")" in
checkpoint)
cat /etc/cp-release
;;
openwrt) openwrt)
# shellcheck disable=SC1091 # shellcheck disable=SC1091
(. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION") (. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION")

View file

@ -21,6 +21,9 @@
set +e set +e
case "$("$__explorer/os")" in case "$("$__explorer/os")" in
checkpoint)
echo "CheckPoint"
;;
openwrt) openwrt)
# shellcheck disable=SC1091 # shellcheck disable=SC1091
(. /etc/openwrt_release && echo "$DISTRIB_ID") (. /etc/openwrt_release && echo "$DISTRIB_ID")

View file

@ -21,6 +21,9 @@
set +e set +e
case "$("$__explorer/os")" in case "$("$__explorer/os")" in
checkpoint)
sed /etc/cp-release -e 's/.* R\([1-9][0-9]*\)\.[0-9]*$/\1/'
;;
openwrt) openwrt)
# shellcheck disable=SC1091 # shellcheck disable=SC1091
(. /etc/openwrt_release && echo "$DISTRIB_RELEASE") (. /etc/openwrt_release && echo "$DISTRIB_RELEASE")

View file

@ -116,6 +116,13 @@ if [ -f /etc/slackware-version ]; then
exit 0 exit 0
fi fi
# Appliances
if grep -q '^Check Point Gaia' /etc/cp-release 2>/dev/null; then
echo checkpoint
exit 0
fi
uname_s="$(uname -s)" uname_s="$(uname -s)"
# Assume there is no tr on the client -> do lower case ourselves # Assume there is no tr on the client -> do lower case ourselves

View file

@ -34,5 +34,9 @@ elif test -f /var/run/os-release
then then
# FreeBSD (created by os-release service) # FreeBSD (created by os-release service)
cat /var/run/os-release cat /var/run/os-release
elif test -f /etc/cp-release
then
# Checkpoint firewall or management (actually linux based)
cat /etc/cp-release
fi fi

View file

@ -41,6 +41,9 @@ in
# empty, but well... # empty, but well...
cat /etc/arch-release cat /etc/arch-release
;; ;;
checkpoint)
awk '{version=$NF; printf("%s\n", substr(version, 2))}' /etc/cp-release
;;
debian) debian)
debian_version=$(cat /etc/debian_version) debian_version=$(cat /etc/debian_version)
case $debian_version case $debian_version