Skip to content

Instantly share code, notes, and snippets.

@thistleknot
Created November 24, 2021 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thistleknot/6f782d9f8ddf21debe00dadd969c5db4 to your computer and use it in GitHub Desktop.
Save thistleknot/6f782d9f8ddf21debe00dadd969c5db4 to your computer and use it in GitHub Desktop.
appendProxyRepos
#!/bin/bash
proxy="replaceme"
for file in *.repo; do
echo $file
for name in $(grep '\[*\]' $file | sed 's/[][]//g'); do
echo $name
sed "/^\[$name\]/a\{$proxy}" $file | sed 's/[{}]//g' >> temp-$file
done
mv -f temp-$file $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment