Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- srcfiles=('/etc/apt/sources.list.d/sileo.sources' '/var/mobile/Documents/xyz.willy.Zebra/sources.list' '/var/mobile/Library/Caches/com.saurik.Cydia/sources.list' )
- iteration=0
- for item in ${srcfiles[*]}
- do
- if [[ "$iteration" -eq "0" ]]; then
- grep http $item | sed 's/http/\nhttp/g' | grep ^http | sed 's/\(^http[^ <]*\)\(.*\)/\1/g' > /tmp/srcf
- wc -l /tmp/srcf
- elif [[ "$iteration" -eq "1" ]]; then
- grep http $item | sed 's/http/\nhttp/g' | grep ^http | sed 's/\(^http[^ <]*\)\(.*\)/\1/g' >> /tmp/srcf
- wc -l /tmp/srcf
- elif [[ "$iteration" -eq "2" ]]; then
- grep http $item | sed 's/http/\nhttp/g' | grep ^http | sed 's/\(^http[^ <]*\)\(.*\)/\1/g' >> /tmp/srcf
- wc -l /tmp/srcf
- rm /tmp/srtsrcf
- while read LINE
- do echo ${LINE%/} >> /tmp/srtsrcf
- done < /tmp/srcf
- rm /etc/apt/mergedsources2.txt
- awk '!x[$0]++' /tmp/srtsrcf > /etc/apt/mergedsources2.txt
- cat /etc/apt/mergedsources2.txt
- wc -l /etc/apt/mergedsources2.txt
- else
- echo "iteration $iteration"
- fi
- ((iteration++))
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement