nicsensor/tool/plugin/autoauth.sh
leimingsheng d71261692d code sync
2025-02-26 16:28:01 +08:00

23 lines
377 B
Bash

#!/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