File: test.sh

package info (click to toggle)
pastebinit 1.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 572 kB
  • sloc: python: 361; xml: 123; sh: 63; makefile: 12
file content (23 lines) | stat: -rwxr-xr-x 734 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
teststring="test from pastebinit"

for interpreter in python python3; do
    for pastebin in $(ls pastebin.d/*.conf | sed 's~^pastebin.d/\(.*\)\.conf$~\1~')
    do
        echo "Trying $pastebin ($interpreter)"
        URL=$(echo "$teststring\n$teststring\n$teststring" | $interpreter ./pastebinit -b $pastebin)

        if [ "$pastebin" = "paste.ubuntu.org.cn" ]; then
            out=$(wget -O - -q "$URL" | gzip -d | grep "$teststring")
        else
            out=$(wget -O - -q "$URL" | grep "$teststring")
        fi

        if [ -n "$out" ]; then
            echo "PASS: $pastebin ($URL) ($interpreter)"
        else
            echo "FAIL: $pastebin ($URL) ($interpreter)"
        fi
        echo ""
    done
done