All checks were successful
Build PR in OBS / Build PR in OBS (pull_request_target) Successful in 18s
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
24 lines
656 B
Bash
Executable File
24 lines
656 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eux
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
# Transform the ID from the drive being considered to lower case
|
|
device_publisher_id=$(echo ${ID_FS_PUBLISHER_ID} | tr '[A-Z]' '[a-z]')
|
|
|
|
# Retrieve the publisher ID from the command line and convert to lower case
|
|
cmdline_publisher_id=""
|
|
if grep -q "ir_pub_id" /proc/cmdline; then
|
|
cmdline_publisher_id=$(cat /proc/cmdline | sed -e 's/^.*ir_pub_id=//' -e 's/ .*$//')
|
|
fi
|
|
|
|
# Is this the filesystem we are looking for?
|
|
if [[ "${cmdline_publisher_id}" == "${device_publisher_id}" ]]; then
|
|
# It is the device we are looking for, return success
|
|
exit 0
|
|
else
|
|
# Not a match, return failure
|
|
exit 1
|
|
fi
|