This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# example: ./find-google-ips.sh list.txt > google.txt | |
while IFS= read -r ip | |
do | |
FIND_HOST="$(host $ip)" | |
if [[ $FIND_HOST == *"google"* ]]; then | |
echo $ip | |
fi | |
done < "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
backup_repositories(){ | |
gh repo list ownerusername > 'temp.txt' | |
cut -f1 'temp.txt' > 'repositories.txt' | |
while IFS= read -r repository; do | |
echo "## Start Backup from $repository" | |
directory_name=$(cut -d "/" -f2 <<< $repository) | |
if cd $directory_name; | |
then cd '..'; | |
else gh repo clone $repository; |