|
Lines 5-16
Link Here
|
| 5 |
|
5 |
|
| 6 |
version="0.4.0" |
6 |
version="0.4.0" |
| 7 |
what=`basename $0 |sed s/-.*//` |
7 |
what=`basename $0 |sed s/-.*//` |
| 8 |
conf="${what}.conf" |
8 |
conf="/etc/porn-get/porn.conf" |
| 9 |
dir="./" |
9 |
dir="./" |
| 10 |
#dir="/usr/share/${what}-get/" |
10 |
#dir="/usr/share/${what}-get/" |
| 11 |
|
11 |
|
| 12 |
if [ ! -f ${dir}${conf} ]; then |
12 |
if [ ! -f ${conf} ]; then |
| 13 |
echo "E: Opening ${dir}${conf} - ifstream::ifstream (2 No such file or directory)" |
13 |
echo "E: Opening {conf} - ifstream::ifstream (2 No such file or directory)" |
| 14 |
echo |
14 |
echo |
| 15 |
exit 1 |
15 |
exit 1 |
| 16 |
fi |
16 |
fi |
|
Lines 22-37
Link Here
|
| 22 |
echo |
22 |
echo |
| 23 |
exit 1 |
23 |
exit 1 |
| 24 |
fi |
24 |
fi |
| 25 |
cat ${dir}${conf} |grep -v "^#" |grep -i ".*$2.*" |while read pkg url fileext; do echo $pkg $fileext; done |
25 |
cat ${conf} |grep -v "^#" |grep -i ".*$2.*" |while read pkg url fileext; do echo $pkg $fileext; done |
| 26 |
;; |
26 |
;; |
| 27 |
|
27 |
|
| 28 |
stats) |
28 |
stats) |
| 29 |
num=`cat ${dir}${conf} |grep -v "^#" |wc |awk '{ print $1 }'` |
29 |
num=`cat ${conf} |grep -v "^#" |wc |awk '{ print $1 }'` |
| 30 |
echo "Total Packages in $conf: "$num |
30 |
echo "Total Packages in $conf: "$num |
| 31 |
;; |
31 |
;; |
| 32 |
|
32 |
|
| 33 |
pkgnames) |
33 |
pkgnames) |
| 34 |
cat ${dir}${conf} |grep -v "^#" |while read pkg url fileext; do echo $pkg $fileext; done |
34 |
cat ${conf} |grep -v "^#" |while read pkg url fileext; do echo $pkg $fileext; done |
| 35 |
;; |
35 |
;; |
| 36 |
|
36 |
|
| 37 |
*) |
37 |
*) |