|

楼主 |
发表于 2004-11-12 16:11:44
|
显示全部楼层
这个是小锁的脚本
[PHP]tux ~ # cat glc_sync
#!/bin/bash
###
### sync with the chinese portages
###
WORKDIR=.
PORTAGEDIR=/usr/local
if [ `whoami` != "root" ]
then
echo "!!!You are not root"
exit
fi
echo "Begin download the portage"
wget http://www.magiclinux.org/cgi-bin/viewcvs.cgi/gentoo/portage.tar.gz?view=tar -O ${WORKDIR}/portage.tar.gz
if [ $? -ne 0 ]
then
echo "!!!Some error happend when downloading"
exit
fi
echo "Download successed"
echo "Remove the old portage"
rm -rf ${PORTAGEDIR}/portage
echo "Extract the portage file"
tar zxvf ${WORKDIR}/portage.tar.gz -C ${PORTAGEDIR}
if [ $? -ne 0 ]
then
echo "!!!Some error happend when extracting"
exit
fi
echo "Clear the temp file"
rm -f ${WORKDIR}/portage.tar.gz
echo "All successed Enjoy it"[/PHP]
把它存到/root下
chmod +x glc_sync
运行
./glc_sync |
|