sysconfig/script_nuance/platform.sh
2021-06-07 10:03:42 +08:00

8 lines
558 B
Bash

#!/bin/bash
PLATFORM=`hostname | perl -ne 'if (/AC-/) {exec "echo aachen_linux"} elsif (/ac-llu/) {exec "echo aachen_windows"} elsif (/ac-nb-llu/) {exec "echo aachen_windows"} elsif (/xena|cvshost|bn-|wa-|grid-/) {exec "echo burlington_linux"} elsif (/neptune/) {exec "echo home_windows"} else {exec "echo unknown"}'`
# it must return some non-empty string for unknown hostnames,
# otherwise it makes if statement be wrong for unknown hostnames:
# if [ $PLATFORM == 'somename' ]
# when $PLATFORM is empty string, there would be nothing to the left of ==.