nicsensor/tool/plugin/autoauth.sh

23 lines
377 B
Bash
Raw Normal View History

2025-02-24 20:15:41 +08:00
#!/bin/sh
2025-02-26 16:28:01 +08:00
# 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