Skip to content
Snippets Groups Projects
Commit ee5a25ba authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

getOS: search in /etc/os-release first

parent f165f5cd
No related branches found
No related tags found
1 merge request!84getOS from /etc/os-release first
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
# 2023-02-16 v1.7 <axel.hahn@unibe.ch> adding a generic min and max value did not really help # 2023-02-16 v1.7 <axel.hahn@unibe.ch> adding a generic min and max value did not really help
# 2023-04-24 v1.8 <axel.hahn@unibe.ch> fix unit conversion # 2023-04-24 v1.8 <axel.hahn@unibe.ch> fix unit conversion
# 2023-05-05 v1.9 <axel.hahn@unibe.ch> user specific counter directory # 2023-05-05 v1.9 <axel.hahn@unibe.ch> user specific counter directory
# 2023-05-17 v1.10 <axel.hahn@unibe.ch> ph.getOS searches in os-release first
# ====================================================================== # ======================================================================
...@@ -87,6 +88,10 @@ function ph.getOS(){ ...@@ -87,6 +88,10 @@ function ph.getOS(){
if [ -z $distro ]; then if [ -z $distro ]; then
# centos7, debian, manjaro, ubuntu # centos7, debian, manjaro, ubuntu
distro=$( grep "^ID=" /etc/os-release | cut -f 2 -d "=" )
fi
if [ -z $distro ]; then
distro=$( grep "^ID=" /etc/*-release | cut -f 2 -d "=" ) distro=$( grep "^ID=" /etc/*-release | cut -f 2 -d "=" )
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment