#! /bin/bash
#written by lengxuezhixuan
#chmod;chown the directory from file
filedir=/root
filename=$filedir/list.txt
sed -i 's#\\#/#g' $filename
sed -i 's#^\^/#/s#g' $filename
sed -i 's#^//#/#' $filename
sed -i 's#/$##g' $filename
sed -i 's#\ $##g' $filename
if [ $(whoami) != root ]
then
echo "please change to root to execute this program"
else
if [ $(pwd) != $filedir ]
then
echo "this path is not $filedir!"
sleep 2
cd $filedir
while read hang
do
chown root:root $hang -R
chmod 755 $hang -R
done < $filename
else
echo "this path is $filedir!"
sleep 2
cd $filedir
while read hang
do
chown root:root $hang -R
chmod 755 $hang -R
done < $filename
fi
fi
阅读(1168) | 评论(0) | 转发(0) |