adjust build dir

This commit is contained in:
2024-10-19 16:29:21 +08:00
parent 0417696884
commit 88b1ac4a7c
3935 changed files with 76 additions and 36 deletions

30
extra/tools/change_mode Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
if [ $# -ne "3" ] ;then
echo "Change the directory, sub-directory and file with seperate permission mode"
echo "Usage: chmmod 755 644 directory"
exit
fi
dir_mode=$1
file_mode=$2
mod_dir=$3
#change the main directory first
chmod $dir_mode $mod_dir
cd $mod_dir
obj_list="`ls -R`"
for obj in $obj_list; do
if [ `echo $obj|grep -c '^\.'` -gt 0 ] ;then
#echo $obj is a dir
cur_dir="`echo $obj|awk -F: '{print $1}'`"
chmod $dir_mode $cur_dir
else
#echo $obj is file,cur_dir=$cur_dir chmod $dir_mode $cur_dir/$obj
chmod $file_mode $cur_dir/$obj
fi
done