forked from Cloudxtreme/wglftpd
-
Notifications
You must be signed in to change notification settings - Fork 1
/
wpzs-ng-2.0.sh
executable file
·220 lines (194 loc) · 9.79 KB
/
wpzs-ng-2.0.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/bin/bash
##################################################################################
##### LICENSE ####################################################################
##################################################################################
#### ####
#### Copyright (C) 2018 wuseman <[email protected]> ####
#### ####
#### This program is free software: you can redistribute it and/or modify ####
#### it under the terms of the GNU General Public License as published by ####
#### the Free Software Foundation, either version 3 of the License, or ####
#### (at your option) any later version. ####
#### ####
#### This program is distributed in the hope that it will be useful, ####
#### but WITHOUT ANY WARRANTY; without even the implied warranty of ####
#### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ####
#### GNU General Public License at <http://www.gnu.org/licenses/> for ####
#### more details. ####
#### ####
##################################################################################
##### GREETINGS ##################################################################
##################################################################################
#### ####
#### To all developers that contributes to all kind of open source projects ####
#### Keep up the good work! #<3#
#### ####
#### https://sendit.nu & https://github.com/wuseman ####
#### ####
##################################################################################
#### DESCRIPTION #################################################################
##################################################################################
#### ####
#### Automated glftpd installation togheter with a realtime crc addon from ####
#### pzs-ng, this script has been tested and verified on machines with ####
#### following distros: Gentoo, Debian & Ubuntu ####
#### ####
#### Enjoy another awesome 'bash' script from wuseman. Questions? Conact me! ####
#### ####
##################################################################################
#### Begin of code ##############################################################
##################################################################################
##################################################################################
# NO REASON TO REMOVE THIS #
##################################################################################
AUTHOR="wuseman"
VERSION="2.0"
banner_pzsng() {
cat <<EOF
██████╗ ███████╗███████╗ ███╗ ██╗ ██████╗
██╔══██╗╚══███╔╝██╔════╝ ████╗ ██║██╔════╝ Author: $AUTHOR
██████╔╝ ███╔╝ ███████╗█████╗██╔██╗ ██║██║ ███╗ Version: $VERSION
██╔═══╝ ███╔╝ ╚════██║╚════╝██║╚██╗██║██║ ██║
██║ ███████╗███████║ ██║ ╚████║╚██████╔╝
╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═══╝ ╚═════╝
EOF
}
##################################################################################
# RUN ONLY IF EUID IS 0 'echo $EUID' #
##################################################################################
if [[ $EUID -ne 0 ]]; then
banner_pzsng
echo -e "\n[-]\e[1;31m You must be Administrator to run this script\n\e[0m" 2>&1
exit 1
else
##################################################################################
# INSTALL PZS-NG #
##################################################################################
install_pzs-ng() {
banner_pzsng
WORKDIR="/opt"
PZSNG="pzs-ng"
PZSNG_SOURCE="https://github.com/pzs-ng/pzs-ng.git"
cd $WORKDIR
#if [ ! -d "/glftpd/" ]; then
# echo -e "[-] \e[1;31mIt seems glftpd has not been installed yet.\n\e[0m[-] \e[1;31mPlease go install glftp and then run this script again.\n\e[0m"
#exit
#fi
if [ -d "pzs-ng" ]; then
echo -e "[-] \e[0m\e[1;31mIt seems pzs-ng already exist. \n\e[0m[-]\e[0m\e[1;31m Please remove this folder and run script again\e[0m\n"
exit
fi
if [ -f "$WORKDIR/$PZSNG/zipscript/conf/zsconfig.h" ]; then
echo -e "\e[1;31m[-] It seems \e[1;36mzsconfig.h already exist. \n\e[31m[-]\e[0m\e[1;36m Please remove this file and run script again\e[0m\n "
exit
fi
echo -e "[+] Please wait, we are now downloading pzs-ng"
git clone $PZSNG_SOURCE 2> /dev/null
echo -e "[+] \e[1;32mSuccessfully\e[0m downloaded pzs-ng\n"
cd $PZSNG
mv $WORKDIR/$PZSNG/zipscript/conf/zsconfig.h.dist $WORKDIR/$PZSNG/zipscript/conf/zsconfig.h
read -p "[+] Do you want to edit zsconfig.h manually (yes/no): " editzsconfig
case $editzsconfig in
"yes") nano $WORKDIR/$PZSNG/zipscript/conf/zsconfig.h ;;
"*") echo "[+] Ok, we will configure zsconfig.h for you.." ;;
esac
cd $WORKDIR/$PZSNG
echo -e "\n[+] Please wait, we will now configure & install pzs-ng for you. \n";
sleep 2
echo -e "[+] Where is glftpd installed."
read -p "[+] Please enter path(Default: /glftpd): " glftpdpath
if [ ! -d "/glftpd" ]; then
echo -e "[-] \e[1;31mEh, there is no glftpd installed $glftpdpath in root dir...Aborting\e[0m"
exit
fi
if [ -z "glftpdpath" ]; then
./configure
make
make install
else
./configure --with-install-path=$glftpdpath
make
make install
sh $WORKDIR/pzs-ng/scripts/libcopy/libcopy.sh
fi
}
##################################################################################
# CONFIGURE PZS-NG ---- STILL UNDER DEVELOPMENT, WILL BE READY IN NEXT VERSION #
##################################################################################
#
configure_pzs-ng() {
echo -e "
\n########################################################
# CUSTOM CMDS
site_cmd RULES TEXT /ftp-data/misc/site.rules
site_cmd LOCATE EXEC /bin/locate.sh
site_cmd INVITE EXEC /bin/invite.sh
site_cmd RESCAN EXEC /bin/rescan
site_cmd AUDIOSORT EXEC /bin/audiosort
site_cmd request EXEC /bin/tur-request.sh request
site_cmd reqfilled EXEC /bin/tur-request.sh reqfilled
site_cmd requests EXEC /bin/tur-request.sh status
site_cmd reqdel EXEC /bin/tur-request.sh reqfilled[:space:]-hide
site_cmd reqwipe EXEC /bin/tur-request.sh reqwipe
site_cmd s EXEC /bin/tur-botsearch.sh
site_cmd AUDIOSCAN PERL /bin/total-rescan-audiosort.pl
site_cmd ADDAFFIL EXEC /bin/addaffil.sh
site_cmd DELAFFIL EXEC /bin/delaffil.sh
site_cmd LISTAFFILS EXEC /bin/listaffils.sh
site_cmd PRE EXEC /bin/pre.sh
\n########################################################
# CUSTOM
custom-rules !8 *
custom-invite !8 *
custom-rescan !8 *
custom-audiosort !8 *
custom-request 1
custom-reqfilled *
custom-requests *
custom-reqdel 1
custom-reqwipe 1
custom-s * *
custom-audioscan * *
custom-addaffil 1
custom-delaffil 1
custom-listaffils !8 *
custom-pre *
#locate allows users to search priv dirs !!!!, do not use it
custom-locate 1
\n########################################################
# IMDB
post_check /bin/psxc-imdb.sh /site/SECTION/*/*/*.*.*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*/*.*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*/*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*/*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*/*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.*.*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.*.nfo
post_check /bin/psxc-imdb.sh /site/SECTION/*/*.nfo
\n
\n########################################################
# CSScripts
calc_crc *
post_check /bin/zipscript-c *
cscript DELE post /bin/postdel
cscript RMD post /bin/datacleaner
cscript SITE[:space:]NUKE post /bin/cleanup
cscript SITE[:space:]UNNUKE post /bin/postunnuke
cscript SITE[:space:]WIPE post /bin/cleanup
cscript RETR post /bin/dl_speedtest
#######################################################
\n
\n########################################################
# Connection settings #
pasv_ports 65006-66006
pasv_addr 192.168.1.206 1
allow_fxp yes yes yes *
########################################################" >> /etc/glftpd.conf
}
install_pzs-ng
configure_pzs-ng
echo -e "\n\n[+] pzs-ng has succesfully been installed\n\n"
fi