Files
linuxkit/alpine/packages/mobyplatform/usr/bin/mobyplatform
2016-09-12 16:02:07 +01:00

22 lines
413 B
Bash
Executable File

#!/bin/sh
# Returns the platform we are running on
# return the value matching the kvpair in the command line
kvpair()
{
awk -v flag=$1 '{
for(i = 1; i <= NF; i++) {
split($i, kvpair, "=");
if(kvpair[1] == flag) {
printf kvpair[2];
break;
}
}
}' /proc/cmdline
}
PLATFORM=$(kvpair mobyplatform)
[ -z ${PLATFORM} ] && printf unknown || printf ${PLATFORM}