2020-10-14 21:25:32 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PREV_REBOOT_CAUSE="/host/reboot-cause/"
|
|
|
|
DEVICE="/usr/share/sonic/device"
|
|
|
|
PLATFORM=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)
|
2021-02-14 12:40:24 -06:00
|
|
|
PLATFORM_PATH=$DEVICE/$PLATFORM
|
2020-10-14 21:25:32 -05:00
|
|
|
FILENAME="udevprefix.conf"
|
|
|
|
|
|
|
|
if [ "$1" = "clear" ]
|
|
|
|
then
|
2021-02-14 12:40:24 -06:00
|
|
|
if [ -e $PLATFORM_PATH/$FILENAME ]; then
|
|
|
|
rm $PLATFORM_PATH/$FILENAME
|
2020-10-14 21:25:32 -05:00
|
|
|
fi
|
|
|
|
else
|
2021-02-14 12:40:24 -06:00
|
|
|
if [ -e $PLATFORM_PATH/$FILENAME ]; then
|
|
|
|
: > $PLATFORM_PATH/$FILENAME
|
|
|
|
echo -n "$1" > $PLATFORM_PATH/$FILENAME
|
2020-10-14 21:25:32 -05:00
|
|
|
else
|
2021-02-14 12:40:24 -06:00
|
|
|
touch $PLATFORM_PATH/$FILENMAE
|
|
|
|
echo -n "$1" > $PLATFORM_PATH/$FILENAME
|
2020-10-14 21:25:32 -05:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|