| Line 152... |
Line 152... |
| 152 |
|| echo "${PARNAME}" >> unrepairable
|
152 |
|| echo "${PARNAME}" >> unrepairable
|
| 153 |
}
|
153 |
}
|
| 154 |
|
154 |
|
| 155 |
### prints the beginning message ###
|
155 |
### prints the beginning message ###
|
| 156 |
print_working_message() {
|
156 |
print_working_message() {
|
| 157 |
echo "================================================================================"
|
157 |
echo '================================================================================'
|
| 158 |
echo "Working in $(pwd)"
|
158 |
echo "Working in $(pwd)"
|
| 159 |
echo "================================================================================"
|
159 |
echo '================================================================================'
|
| 160 |
}
|
160 |
}
|
| 161 |
|
161 |
|
| 162 |
### prints the ending message ###
|
162 |
### prints the ending message ###
|
| 163 |
print_finished_message() {
|
163 |
print_finished_message() {
|
| 164 |
echo "================================================================================"
|
164 |
echo '================================================================================'
|
| 165 |
echo "Done in $(pwd)"
|
165 |
echo "Done in $(pwd)"
|
| 166 |
echo "================================================================================"
|
166 |
echo '================================================================================'
|
| - |
|
167 |
}
|
| - |
|
168 |
|
| - |
|
169 |
### print a welcome message ###
|
| - |
|
170 |
print_welcome_message() {
|
| - |
|
171 |
echo '================================================================================'
|
| - |
|
172 |
echo '== This is rarslave, a free program designed to assist you in repairing and =='
|
| - |
|
173 |
echo '== extracting files that you have downloaded from USENET. It will work on any =='
|
| - |
|
174 |
echo '== file set with a par2 and rar. It also works for sets with just par2 =='
|
| - |
|
175 |
echo '== associated. In that case, it repairs then removes the par2 (if successful) =='
|
| - |
|
176 |
echo '== =='
|
| - |
|
177 |
echo '== Written By ---- Ira Snyder =='
|
| - |
|
178 |
echo '== Start Date ---- 06-08-2005 (ported from zsh) =='
|
| - |
|
179 |
echo '== Last Revised -- 06-08-2005 (appears not to have major bugs now) =='
|
| - |
|
180 |
echo '== License ------- GNU General Public License v2 =='
|
| - |
|
181 |
echo '== License ------- http://www.gnu.org/licenses/gpl.txt =='
|
| - |
|
182 |
echo '== =='
|
| - |
|
183 |
echo '== Thanks for using this program! =='
|
| - |
|
184 |
echo '================================================================================'
|
| - |
|
185 |
echo
|
| 167 |
}
|
186 |
}
|
| 168 |
############################### END FUNCTIONS ##################################
|
187 |
############################### END FUNCTIONS ##################################
|
| 169 |
################################################################################
|
188 |
################################################################################
|
| 170 |
|
189 |
|
| 171 |
GLOBAL_ORIG_DIR="$(pwd)"
|
190 |
GLOBAL_ORIG_DIR="$(pwd)"
|
| 172 |
|
191 |
|
| 173 |
# if we got no args, run in $DLDIR
|
192 |
# if we got no args, run in $DLDIR
|
| 174 |
if [ -z "$@" ]; then
|
193 |
if [ -z "$@" ]; then
|
| - |
|
194 |
|
| - |
|
195 |
print_welcome_message
|
| - |
|
196 |
|
| - |
|
197 |
# switch to the dir from the config and set up the environment
|
| 175 |
cd "${DLDIR}"
|
198 |
cd "${DLDIR}"
|
| 176 |
cleanup_logs
|
199 |
cleanup_logs
|
| 177 |
|
200 |
|
| - |
|
201 |
# run rarslave recursively on every directory . and below
|
| 178 |
find ./ -type d -print0 | xargs -0 -n1 | xargs -I{} rarslave "{}"
|
202 |
find ./ -type d -print0 | xargs -0 -n1 | xargs -I{} rarslave "{}"
|
| 179 |
print_errors
|
203 |
print_errors
|
| 180 |
|
204 |
|
| 181 |
# Print Parting Message
|
205 |
# Print Parting Message
|
| 182 |
echo
|
206 |
echo
|