Changes in trunk/linkchecker.sh [27:2]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/linkchecker.sh
r27 r2 2 2 # 3 3 # module : 4 # check links of acmobefore and after installation4 # check links of bibnemomaf before and after installation 5 5 # cf. install.sh 6 6 # 7 7 # original location : 8 # /usr/home/fplod/ locean/acmo/doc/linkchecker.sh sur aedon.locean-ipsl.upmc.fr8 # /usr/home/fplod/incas/bibnemo/src/bibnemomaf/linkchecker.sh sur aedon.locean-ipsl.upmc.fr 9 9 # 10 # update : 11 # ++ linkchecker ne voit pas les erreurs !! 12 # ++ dirpublish forme fplod@cerbere.locean-ipsl.upmc.fr:./WWW/ par example 13 # donc pas http 14 # + ajouter la possibilite rde faire une carte du site avec 15 # graphiz 16 # exemple synatxe = 17 # $ linkchecker -odot -v http://www.lodyc.jussieu.fr/NEMO/general/biblio_new/ | dot -Tps > sitemap.ps 10 # update :: 11 # fplod 2007-04-04T14:09:58Z aedon.locean-ipsl.upmc.fr (Darwin) 12 # creation 18 13 # 19 # remove "set -u" because I don't know how to test if there is at least 20 # one directory AND one url to be checked without this option 21 # !! ++ must be restore ASAP 22 # fplod 2007-10-12T07:32:08Z aedon.locean-ipsl.upmc.fr (Darwin) 23 # add -u pour url 24 # add multiple -d and suppression of interactivity 25 # replace -w by -d (more generic) 26 # use rather checklink than linkchecker because the first one exist either 27 # on Mac and Unix, and because the second one exists only on Mac and 28 # does'nt seem to detect every problem 29 # fplod 2007-10-11T15:31:25Z aedon.locean-ipsl.upmc.fr (Darwin) 30 # parametrization 31 # merge with checklink.sh ++ choisir entre les deux 32 # fplod 2007-06-19T09:26:04Z aedon.locean-ipsl.upmc.fr (Darwin) 33 # création 14 set -u 15 set -o posix 16 command=$(basename ${0}) 34 17 # 35 set -o posix 36 command=$(basename ${0} .sh) 37 log_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 38 log=/tmp/${command}.log.${log_date} 18 # ++ simu paramètre 19 DIRWWW=/usr/temp/${LOGNAME}/public_html/bibnemomaf/ 39 20 # 40 usage=" Usage : ${command} -d dircheck -u url"21 linkcheckeropt="--anchors --recursion-level=-1" 41 22 # 42 minargcount=2 43 #echo " narg ${#}" 44 if [ ${#} -lt ${minargcount} ] 23 # test if linkchecker is available 24 type linkchecker 1> /dev/null 2>&1 25 status=${?} 26 if [ ${status} -ne 0 ] 45 27 then 46 echo "eee : not enought arguments" 47 echo "${usage}" 48 exit 1 28 echo " eee : linkchecker not found" 29 exit 1 49 30 fi 50 31 # 51 idircheck=0 52 iurl=0 53 while [ ! -z "${1}" ] 54 do 55 case ${1} in 56 -d) 57 idircheck=$(( ${idircheck} + 1 )) 58 dircheck[${idircheck}]=${2} 59 shift 32 echo " " 33 #++fverif=${DIRWWW}/en/one/bibnemomaf00.html 34 fverif="file://"${DIRWWW}/en/one/bibnemomaf00.html 35 nverif=wwwone00 36 echo " Do you want to check ${fverif} (y|[n]) ?" 37 anwser=" " 38 read anwser 39 case ${anwser} in 40 y|Y) 41 log=/tmp/linkchecker${nverif}.log 42 err=/tmp/linkchecker${nverif}.err 43 echo "iii : check of ${fverif}" 44 linkchecker \ 45 ${linkcheckeropt} \ 46 ${fverif} \ 47 1> ${log} 2> ${err} 48 echo "iii : log in ${log}" 60 49 ;; 61 -u) 62 iurlcheck=$(( ${iurlcheck} + 1 )) 63 urlcheck[${iurlcheck}]=${2} 64 shift 50 *) 51 echo "iii : no check of ${fverif}" 65 52 ;; 66 esac 67 shift # next flag 68 done 53 esac 69 54 # 70 # +++ remove temporarily 71 # +++ set -u 55 echo " " 56 #++fverif=${DIRWWW}/en/one/bibnemomaf01.html 57 fverif="file://"${DIRWWW}/en/one/bibnemomaf01.html 58 nverif=wwwone00 59 echo " Do you want to check ${fverif} (y|[n]) ?" 60 anwser=" " 61 read anwser 62 case ${anwser} in 63 y|Y) 64 log=/tmp/linkchecker${nverif}.log 65 err=/tmp/linkchecker${nverif}.err 66 echo "iii : check of ${fverif}" 67 linkchecker \ 68 ${linkcheckeropt} \ 69 ${fverif} \ 70 1> ${log} 2> ${err} 71 echo "iii : log in ${log}" 72 ;; 73 *) 74 echo "iii : no check of ${fverif}" 75 ;; 76 esac 72 77 # 73 # ++ check directories or URL74 #75 # choose the command to be used76 #77 commandcheck=checklink78 #79 if [ ${commandcheck} = "linkchecker" ]80 then81 # test if linkchecker is available82 type ${commandcheck} 1> /dev/null 2>&183 status=${?}84 if [ ${status} -ne 0 ]85 then86 echo "${command} : eee : ${commandcheck} unavailable"87 exit 188 fi89 optcheck="--anchors --recursion-level=-1"90 fi91 #92 if [ ${commandcheck} = "checklink" ]93 then94 # test if checklink is available95 type ${commandcheck} 1> /dev/null 2>&196 status=${?}97 if [ ${status} -ne 0 ]98 then99 echo "${command} : eee : ${commandcheck} unavailable"100 exit 1101 fi102 #103 optcheck="--summary --recursive"104 fi105 #106 # loop on directories to be checked107 dirchecksize=${#dircheck[@]} # ++ pb set -u108 if [ ${dirchecksize} -gt 0 ]109 then110 idircheck=1111 while [ ${idircheck} -le ${dirchecksize} ]112 do113 echo "iii : beginning of check of ${dircheck[${idircheck}]}" 1>>${log}114 fverif="file://"${dircheck[${idircheck}]}115 echo "iii : check of ${fverif}"116 ${commandcheck} ${optcheck} ${fverif} 1>>${log} 2>&1117 idircheck=$(( ${idircheck} + 1 ))118 done119 fi120 #121 # loop on urls to be checked122 urlchecksize=${#urlcheck[@]} # ++ pb set -u123 if [ ${urlchecksize} -gt 0 ]124 then125 iurlcheck=1126 while [ ${iurlcheck} -le ${urlchecksize} ]127 do128 echo "iii : beginning of check of ${urlcheck[${iurlcheck}]}" 1>>${log}129 # ++ test si urlcheck commence par http ou pas130 fverif=${urlcheck[${iurlcheck}]}131 echo "iii : check of ${fverif}"132 ${commandcheck} ${optcheck} ${fverif} 1>>${log} 2>&1133 iurlcheck=$(( ${iurlcheck} + 1 ))134 done135 fi136 #137 echo "iii : log in ${log}"138 # end139 78 exit
Note: See TracChangeset
for help on using the changeset viewer.