comparison moefetch.sh @ 167:78ac6fd03e3a

more fix
author edhoprima@gmail.com <edhoprima@gmail.com>
date Fri, 05 Jun 2009 19:29:18 +0000
parents cc60e8cf7793
children 2781576c06a5
comparison
equal deleted inserted replaced
166:cc60e8cf7793 167:78ac6fd03e3a
114 } 114 }
115 115
116 # verify required folders exist and writeable 116 # verify required folders exist and writeable
117 Check_Folders(){ 117 Check_Folders(){
118 [ -O "${BASE_DIR}" ] || Err_Fatal "You don't own ${BASE_DIR}. Please fix ${BASE_DIR}." 118 [ -O "${BASE_DIR}" ] || Err_Fatal "You don't own ${BASE_DIR}. Please fix ${BASE_DIR}."
119 for FOLDER in temp trash deleted ${TARGET_DIR} 119 for FOLDER in temp trash deleted ${SITE_DIR}/${TARGET_DIR}
120 do 120 do
121 if [ ! -d "${BASE_DIR}/${FOLDER}" ]; then 121 if [ ! -d "${BASE_DIR}/${FOLDER}" ]; then
122 mkdir "${BASE_DIR}/${FOLDER}" || Err_Fatal "${FOLDER} folder creation failed" 122 mkdir "${BASE_DIR}/${FOLDER}" || Err_Fatal "${FOLDER} folder creation failed"
123 fi 123 fi
124 if [ ! -O "${BASE_DIR}/${FOLDER}" ]; then 124 if [ ! -O "${BASE_DIR}/${FOLDER}" ]; then
125 echo "You don't own the ${BASE_DIR}/{$FOLDER}, applying globally writeable permission on it" 125 echo "You don't own the ${BASE_DIR}/${FOLDER}, applying globally writeable permission on it"
126 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${FOLDER}" || Err_Fatal "Error changing ownership. This shouldn't happen" 126 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${FOLDER}" || Err_Fatal "Error changing ownership. This shouldn't happen"
127 fi 127 fi
128 done 128 done
129 [ `echo \`ls "${BASE_DIR}/${TARGET_DIR}" | wc -l\`` -eq 0 ] && ISNEW=1 129 [ `echo \`ls "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}" | wc -l\`` -eq 0 ] && ISNEW=1
130 # let's move to workdir 130 # let's move to workdir
131 cd "${BASE_DIR}/temp" 131 cd "${BASE_DIR}/temp"
132 for i in error ok list newlist; do 132 for i in error ok list newlist; do
133 touch "${SITE_DIR}-${TARGET_DIR}-${i}" || Fatal_Err "Error creating ${TARGET_DIR}-${i}. This shouldn't happen" 133 touch "${SITE_DIR}-${TARGET_DIR}-${i}" || Fatal_Err "Error creating ${TARGET_DIR}-${i}. This shouldn't happen"
134 done 134 done