comparison moefetch.sh @ 166:cc60e8cf7793

dunno :<
author edhoprima@gmail.com <edhoprima@gmail.com>
date Fri, 05 Jun 2009 19:24:27 +0000
parents 9495944e326b
children 78ac6fd03e3a
comparison
equal deleted inserted replaced
165:9495944e326b 166:cc60e8cf7793
135 # 135 #
136 } 136 }
137 137
138 # check files correctness 138 # check files correctness
139 Check_Files() { 139 Check_Files() {
140 if [ "$ISNEW" -ne 1 ]; then 140 if [ ! "${ISNEW}" ]; then
141 echo "Checking for errors..." 141 echo "Checking for errors..."
142 # THE FILES 142 # THE FILES
143 143
144 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR} 144 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}
145 cd "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}" 145 cd "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}"
191 echo "quick mode selected. Skipping check" 191 echo "quick mode selected. Skipping check"
192 else 192 else
193 echo "Empty local repository" 193 echo "Empty local repository"
194 fi 194 fi
195 cd "${BASE_DIR}/temp" 195 cd "${BASE_DIR}/temp"
196 cat "${SITE_DIR}-${TARGET_DIR}-list" > "${TARGET_DIR}-newlist" 196 cat "${SITE_DIR}-${TARGET_DIR}-list" > "${SITE_DIR}-${TARGET_DIR}-newlist"
197 fi 197 fi
198 } 198 }
199 199
200 # start downloading the images 200 # start downloading the images
201 Fetch_Images() { 201 Fetch_Images() {
218 # path initialization 218 # path initialization
219 [ "${ADDITIONAL_PATH}" ] && PATH=${ADDITIONAL_PATH}:${PATH} 219 [ "${ADDITIONAL_PATH}" ] && PATH=${ADDITIONAL_PATH}:${PATH}
220 export PATH 220 export PATH
221 221
222 # misc variables 222 # misc variables
223 ISQUICK="" 223 ISQUICK=
224 ISNEW="" 224 ISNEW=
225 225
226 [ $# -lt 2 ] && Err_Help 226 [ $# -lt 2 ] && Err_Help
227 case "$1" in 227 case "$1" in
228 status|fetch|quickfetch) 228 status|fetch|quickfetch)
229 echo "Starting..." 229 echo "Starting..."
243 ;; 243 ;;
244 *) 244 *)
245 SITE="${DEFAULT_SITE}" 245 SITE="${DEFAULT_SITE}"
246 ;; 246 ;;
247 esac 247 esac
248 TAGS=$@ 248 TAGS="$@"
249 echo "Tags: ${TAGS}" 249 echo "Tags: ${TAGS}"
250 # slash is not wanted for folder name 250 # slash is not wanted for folder name
251 TARGET_DIR="`echo "${TAGS}" | sed -e 's/\//_/g'`" 251 TARGET_DIR="`echo "${TAGS}" | sed -e 's/\//_/g'`"
252 SITE_DIR="`echo "${SITE}" | sed -e 's/\/$//g;s/\//_/g'`" 252 SITE_DIR="`echo "${SITE}" | sed -e 's/\/$//g;s/\//_/g'`"
253 } 253 }