Commit 9787f9c2 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Use /etc/motd to check if a system is OpenBSD

In OpenBSD the first line(s) get overwritten upon each boot by
the rc scripts and kernel informations are added
parent 0925f23a
......@@ -194,13 +194,13 @@ get_base_distro() {
elif [ -e "$root_dir/etc/freebsd-update.conf" ]; then
echo "freebsd"
elif [ -e "$root_dir/etc/release" ]; then
if grep -in netbsd "$root_dir/etc/release" &> /dev/null; then
if grep -i netbsd "$root_dir/etc/release" &> /dev/null; then
echo "netbsd"
else
warn "Unknown Unix flavor."
fi
elif [ -e "$root_dir/etc/magic" ]; then
if grep -in openbsd "$root_dir/etc/magic" &> /dev/null; then
elif [ -e "$root_dir/etc/motd" ]; then
if grep -i ^openbsd <(head -1 "$root_dir/etc/motd") &> /dev/null; then
echo "openbsd"
else
warn "Unknown Unix flavor"
......@@ -245,8 +245,8 @@ get_distro() {
else
warn "Unknown Unix flavor"
fi
elif [ -e "$root_dir/etc/magic" ]; then
if grep -in openbsd "$root_dir/etc/magic" &> /dev/null; then
elif [ -e "$root_dir/etc/motd" ]; then
if grep -i ^openbsd <(head -1 "$root_dir/etc/motd") &> /dev/null; then
echo "openbsd"
else
warn "Unknown Unix flavor"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment