mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-06 04:25:29 +00:00
22 lines
413 B
Bash
Executable File
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}
|