Skip to content

Commit

Permalink
debian check
Browse files Browse the repository at this point in the history
  • Loading branch information
m-1-k-3 committed Oct 21, 2024
1 parent f1aff71 commit 2f2c303
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/distri_id.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ supermicrox11-bmc;/sbin/net-snmp-config; grep -E "x11.*AST2400.*arm-linux.*PLATF
OpenWRT;/etc/openwrt_release;grep -a -o -E -e "^DISTRIB_ID=.*" -a -o -E -e "^DISTRIB_RELEASE=.*[0-9].*" -a -o -E -e "^DISTRIB_REVISION=.*";sed 's/DISTRIB_ID=//g' | sed 's/DISTRIB_RELEASE=//g' | sed 's/DISTRIB_REVISION=//g'
OpenWRT;/etc/openwrt_version;grep -E -e "[0-9]+\.[0-9]+";sed -e 's/^/OpenWrt\ /g'
buildroot;/etc/os-release;grep -a -o -E -e "^NAME=.*" -a -o -E -e "^VERSION_ID=[0-9].*";sed 's/NAME=//g' | sed 's/VERSION_ID=//g'
debian-Linux;/etc/debian_version;grep -a -o -E -e "[0-9]+(\.[0-9]+)+?";sed 's/^/debian\ /'
os-release-Linux;/etc/os-release;grep -a -o -E -e "^ID=.*" -a -o -E -e "^VERSION_ID=.*";sed 's/VERSION_ID=//g' | sed 's/ID=//g'
lsb-release-Linux;/etc/lsb-release;grep -a -o -E -e "^DISTRIB_ID=.*" -a -o -E -e "^DISTRIB_RELEASE=.*";sed 's/DISTRIB_ID=//g' | sed 's/DISTRIB_RELEASE=//g'
debian-Linux;/etc/debian_version;grep -a -o -E -e "[0-9]+(\.[0-9]+)+?";sed 's/^/debian\ /'
DD-WRT;/etc/motd;grep -a -o -E "DD-WRT v[0-9]+(-sp[0-9])?";sort -u
# DD-WRT build #23
DD-WRT;/etc/motd;grep -a -o -E "DD-WRT build.\#[0-9][0-9]";sort -u
Expand Down
8 changes: 8 additions & 0 deletions modules/S06_distribution_identification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ S06_distribution_identification()
lSEARCH_FILE="$(safe_echo "${CONFIG}" | cut -d\; -f2)"
# echo "lSEARCH_FILE: $lSEARCH_FILE"
# echo "FIRMWARE_PATH: $FIRMWARE_PATH"
if [[ "${lSEARCH_FILE}" == *"os_release"* ]] || [[ "${lSEARCH_FILE}" == *"lsb-release"* ]]; then
# lets check if we have already a valid debian entry -> if so, we can skip this test
# this usually happens if we have already found an os_release or lsb-release file
if grep -qE "debian_linux:[0-9]+" "${S06_CSV_LOG}"; then
print_output "[*] Already identified Debian Linux version -> skipping further tests now" "no_log"
continue
fi
fi
mapfile -t lFOUND_FILES_ARR < <(find "${FIRMWARE_PATH}" -xdev -iwholename "*${lSEARCH_FILE}" || true)
for lFILE in "${lFOUND_FILES_ARR[@]}"; do
# print_output "lFILE: ${lFILE}"
Expand Down

0 comments on commit 2f2c303

Please sign in to comment.