思路不错,感谢楼主的分享
直接把脚本写到 local/bin 目录相对更简单些
tee /usr/local/bin/wget <<-'EOF'
#!/bin/bash
opts=$@
opts=`echo $opts | sed -e 's;raw.githubusercontent.com;raw.staticdn.net;g' -e 's;https://raw.github.com/;https://raw.staticdn.net/;g' -e 's;https://github.com/;https://github.com.cnpmjs.org/;g' -e 's;https://;http://;g' `
/usr/bin/wget ${opts}
EOF
chmod +x /usr/local/bin/wget