mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-17 01:28:29 -05:00
* Adding spec file and github pipeline for testing * Restructure github pipelines for more clarity * Add build tests for several RPM based distributions --------- Co-authored-by: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>
18 lines
609 B
Bash
18 lines
609 B
Bash
#!/bin/sh -e
|
|
# workaround for really bare-bones Archlinux containers:
|
|
if [ -x "$(command -v pacman)" ]; then
|
|
pacman --noconfirm -Sy
|
|
pacman --noconfirm -S grep gawk sed
|
|
fi
|
|
|
|
os_release_file=
|
|
if [ -s "/etc/os-release" ]; then
|
|
os_release_file="/etc/os-release"
|
|
elif [ -s "/usr/lib/os-release" ]; then
|
|
os_release_file="/usr/lib/os-release"
|
|
else
|
|
echo >&2 "Cannot find an os-release file ..."
|
|
return 1
|
|
fi
|
|
export distro_id=$(grep '^ID=' $os_release_file|awk -F = '{print $2}'|sed 's/\"//g')
|
|
export platform_id=$(grep '^PLATFORM_ID=' /etc/os-release|awk -F = '{print $2}'|sed 's/\"//g'| cut -d":" -f2)
|