b46bbba2760872f26e78a628584d02b888300f3a
[dotfiles-public.git] / src / .bashrc.d / 01detect_system
1 # Detect the type of system we're running on
2 #
3 # This makes it easy to adjust script locations and so forth to match
4 # your system's file placement and other quirks.
5
6 if test -z "${OS}"; then
7         export OS='UNKNOWN'
8         _OS="$(source /etc/os-release && echo "${ID}")"
9         if test -n "_OS"; then
10                 export OS="${_OS}"
11         elif grep -i sunos /etc/motd > /dev/null 2>&1; then
12                 export OS='SunOS'
13         else
14                 echo "unknown system.  Adjust .bashrc.d/01detect_system or set OS by hand" >&2
15         fi
16 fi