下载并修改

#!/bin/bash
lftpget ftp://192.168.0.254:/pub/gls/centos.repo /tmp
if ls -l /tmp | grep "^centos.repo$" &> /dev/null; then
CENTORS="/tmp/centos.repo"
echo "$CENTORS is here"
sed -i "s\^baseurl=.*\baseurl=http://mirrors.sohu.com/centos\g" $CENTORS
mv $CENTORS /etc/repos.d/
else
echo "$CENTORS is not here."
fi

本文出自 “天天看” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲,12.22)