|
发表于 2004-11-1 11:57:21
|
显示全部楼层
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"
复制代码
试试这个代码。 |
|