code sync

This commit is contained in:
leimingsheng 2025-02-26 16:28:01 +08:00
parent 99cd4926d6
commit d71261692d
2 changed files with 37 additions and 0 deletions

@ -1 +1,23 @@
#!/bin/sh
# Get file conut first
file_num=`ls -l | wc -l`
i=2
while true
do
i=$(($i+1))
# Get filename by ls and awk
file=`ls -l | awk -v cnt=$i 'NR==cnt{print $9}'`
cmd="chmod +x $file"
echo "File ID: $i , $cmd"
# perform chmod
$cmd
if [ $i -eq $file_num ];then
echo "Done to add exec auth for every file"
break
fi
done

@ -22,6 +22,15 @@ print_helper(){
echo "For Detect: ./nicsensor.sh detect [ocp/pcie]"
}
perform_detect(){
if [ ! -e $server_script ];then
$fmt_print "console" "Error" "Server Script $server_script not exist! Maybe unsupport for now!"
exit 1
fi
$server_script "detect"
}
conf_pre_check(){
if [ $param_num -lt 1 ];then
@ -91,6 +100,12 @@ start_sensor_reading(){
# ---------------------------------------------------------
# Start Execute Script
# ---------------------------------------------------------
# check if is detect option
if [ "$1" = "detect" ];then
perform_detect
exit 0
fi
conf_pre_check
parse_slot_name