| •1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved. |
| 4 |
# |
| 5 |
# Licensed under the MIT License. See the LICENSE accompanying this file |
| 6 |
# for the specific language governing permissions and limitations under |
| 7 |
# the License. |
| 8 |
|
| 9 |
#Expected input if partition's kernel name like nvme0n1p2 |
| 10 |
if [ $# -eq 0 ] ; then |
| 11 |
exit 1 |
| 12 |
else |
| 13 |
# extract ns id from partition's kernel name and export it |
| 14 |
NSID=$(echo -n "$@" | cut -f 3 -d 'n' | cut -f 1 -d 'p') |
| 15 |
echo "_NS_ID=${NSID}" |
| 16 |
fi |