1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/bin/sh tmpfile=/tmp/os os="$(uname)" if [ "$os" = "Linux" ]; then grep "Artix" /etc/issue >/dev/null 2>&1 && os=1 || os=2 elif [ "$os" = "FreeBSD" ]; then os=3 else echo "unknown OS" exit 1 fi echo -n $os >$tmpfile