Hi folks!!!
Is there any reliable way to judge that the current linux system is Openwrt?
I am writing a commandline program with rust and target with x86_64-unknown-linux-musl. it runs on Debian、CentOS、openwrt etc. Debian use systemd as service manager, but openwrt not.
What is your purpose? Installing packages?
Tweaking a generic startup script in case the system is OpenWrt?
Many OEM firmwares are based on OpenWrt and some OEMs even leave the underlying OpenWrt branding and ID files there. So looking for a file like /etc/openwrt_release might tell that the system is based on OpenWrt but might not be conclusive on the system really being "normal" OpenWrt.
One common thing for OpenWrt based systems might be the "procd" process manager. If process with PID 1 is "/sbin/procd", the system is almost certainly OpenWrt based (but might still be an OEM variant).
I am writing a commandline program with rust and target with x86_64-unknown-linux-musl. it runs on Debian、CentOS、openwrt etc. Debian use systemd as service manager, but openwrt not.
Can't (lsb) /etc/*release be referenced? This is what I use, before that it was a bunch of switch/esac statements based on various things like uname, as hnyman mentions.