-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsbrkey
31 lines (28 loc) · 795 Bytes
/
sbrkey
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
29
30
31
#!/bin/sh
echo '******************************************'
echo '*** SBRKEY Console Downloader v0.0.2 ***'
echo '*** ***'
echo '*** written by istallia ***'
echo '******************************************'
echo ''
api='https://textblog.minibird.jp/sbrkey/key2url.php'
echo -n 'Type your key: '
read key
curl "$api?no_inc=false&key=$key" | {
read url
#echo "$url"
if [ "$url" = 'No SBRKEY' ]; then
echo 'Error: No SBRKEY typed' 1>&2
exit 1
fi
if [ "$url" = 'Not found' ]; then
echo 'Error: The SBRKEY is not found' 1>&2
exit 1
fi
if [ "$url" = 'ERROR!' ]; then
echo 'Error: Unknown error (probably a problem with DB)' 1>&2
exit 1
fi
wget --trust-server-names --content-disposition "$url"
}
exit 0