summaryrefslogtreecommitdiff
path: root/bin/sources_test
blob: a63c5b9ca280ecd341d0f452331819437ce9722f (plain)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 
#!/bin/bash result=0 sources_list=$1 repositories=$2 if [ -z "$sources_list" ]; then echo "Must provide sources list location, e.g. /etc/apt/sources.list" exit 1 fi if [ -z "$repositories" ]; then echo "Must provide list of repositories to check for, e.g. 'deb http://gb.archive.ubuntu.com/ubuntu/ precise multiverse, deb http://gb.archive.ubuntu.com/ubuntu/ precise-updates multiverse'" exit 1 fi IFS=$',' for repository in $repositories; do if grep -q "$repository" "$sources_list"; then echo "$repository found in $sources_list" else echo "$repository not found in $sources_list" result=1 fi done exit $result