Cierto, en un wiki sería ideal. No me había dado cuenta que por eso eran los errores 2008/7/14 Marcos Guglielmetti <[email protected]>:
En Musix (debian etch derivado) /bin/httpduser: line 5: : command not found /bin/httpduser: line 6: : command not found /bin/httpduser: line 7: : command not found /bin/httpduser: line 8: : command not found /bin/httpduser: line 9: : command not found /bin/httpduser: line 10: : command not found /bin/httpduser: line 15: syntax error near unexpected token `do' /bin/httpduser: line 15: ` for H2 in /apache2 /apache/conf /httpd/conf /httpd ""; do'
sería mejor si lo pasás como archivo separado, adjunto, lo colgás de algún sitio o lo adjuntás acá en el mail, dado que copiando y pegando a veces se generan cortes de línea indeseados... esto es lo que tengo acá
#!/bin/bash export HTTPDUSER=`ps -eo user,args|grep 'httpd'|grep -v 'root'| tail -n1|awk '{print $1}'`
if test $HTTPDUSER; then export HTTPDGRP=`ps -eo group,args|grep 'httpd'|grep -v 'root'| tail -n1|awk '{print $1}'` export HTTPDCONF=`ps -eo user,args|grep 'httpd'|grep -v 'root'| tail -n1|perl -e '$a=<>;$a=~/-f ([\.\w\/]+)/;print $1'` else export HTTPDUSER=`ps -eo user,args|grep 'apache'|grep -v 'root'| tail -n1|awk '{print $1}'` export HTTPDGRP=`ps -eo group,args|grep 'apache'|grep -v 'root'| tail -n1|awk '{print $1}'` export HTTPDCONF=`ps -eo user,args|grep 'apache'|grep -v 'root'| tail -n1|perl -e '$a=<>;$a=~/-f ([\.\w\/]+)/;print $1'` fi #IFS=: CAMINO="/etc /usr/local /usr /opt" for H1 in $CAMINO; do for H2 in /apache2 /apache/conf /httpd/conf /httpd ""; do for H3 in /default-server.conf /vhosts.d/default_vhost.include /sites-available/default.dpkg-dist /apache.conf /httpd.conf; do HP="$H1$H2$H3" #echo "# $HP" if test -e $HP; then HTTPDCONF=$HP export HTTPDPROOT=`cat $HTTPDCONF| awk '/^[\s\t\b]*DocumentRoot / {print $2}'|sed 's/"//g'` #echo $HTTPDCONF - $HTTPDPROOT if test $HTTPDPROOT; then break 5 fi fi done done done
if test $HTTPDCONF; then export HTTPDCONF export HTTPDPROOT=`cat $HTTPDCONF| awk '/^[\s\t\b]*DocumentRoot / {print $2}'|sed 's/"//g'` export HTTPDROOT=`echo $HTTPDPROOT|awk '{print $1}'` export HTTPDPCGI=`cat $HTTPDCONF| awk '/^[\s\t]*ScriptAlias / {print $3}'|sed 's/"//g'|sed 's/\/$//'` export HTTPDCGI=`echo $HTTPDPCGI|awk '{print $1}'` fi
#echo "Detecta caracteristicas del Apache" echo USR=$HTTPDUSER echo GRP=$HTTPDGRP #echo CONF=$HTTPDCONF echo WEBDOC=$HTTPDROOT echo WEBCGI=$HTTPDCGI
if ! test $HTTPDUSER; then echo "#EL APACHE NO TIENE USUARIO, estara apagado?, esto es capturado y no sale, arreglar" fi
El Martes, 15 de Julio de 2008 00:33, Diego Saravia escribió: | este es un viejo script que necesito reflotar | | se animan a probarlo en cuanta maquina conozcan o quieran y | decirme si funciona? | | desde ya acepto risas, criticas, sugerencias o mejoras | | gracias | | | #!/bin/bash | export HTTPDUSER=`ps -eo user,args|grep 'httpd'|grep -v | 'root'|tail -n1|awk '{print $1}'` | | if test $HTTPDUSER; then | export HTTPDGRP=`ps -eo group,args|grep 'httpd'|grep -v | 'root'|tail -n1|awk '{print $1}'` | export HTTPDCONF=`ps -eo user,args|grep 'httpd'|grep -v | 'root'|tail -n1|perl -e '$a=<>;$a=~/-f ([\.\w\/]+)/;print $1'` | else | export HTTPDUSER=`ps -eo user,args|grep 'apache'|grep -v | 'root'|tail -n1|awk '{print $1}'` | export HTTPDGRP=`ps -eo group,args|grep 'apache'|grep -v | 'root'|tail -n1|awk '{print $1}'` | export HTTPDCONF=`ps -eo user,args|grep 'apache'|grep -v | 'root'|tail -n1|perl -e '$a=<>;$a=~/-f ([\.\w\/]+)/;print $1'` | fi | #IFS=: | CAMINO="/etc /usr/local /usr /opt" | for H1 in $CAMINO; do | for H2 in /apache2 /apache/conf /httpd/conf /httpd ""; do | for H3 in /default-server.conf | /vhosts.d/default_vhost.include /sites-available/default.dpkg-dist | /apache.conf /httpd.conf; do HP="$H1$H2$H3" | #echo "# $HP" | if test -e $HP; then | HTTPDCONF=$HP | export HTTPDPROOT=`cat $HTTPDCONF| awk | '/^[\s\t\b]*DocumentRoot / {print $2}'|sed 's/"//g'` | #echo $HTTPDCONF - $HTTPDPROOT | if test $HTTPDPROOT; then | break 5 | fi | fi | done | done | done | | if test $HTTPDCONF; then | export HTTPDCONF | export HTTPDPROOT=`cat $HTTPDCONF| awk '/^[\s\t\b]*DocumentRoot | / {print $2}'|sed 's/"//g'` | export HTTPDROOT=`echo $HTTPDPROOT|awk '{print $1}'` | export HTTPDPCGI=`cat $HTTPDCONF| awk '/^[\s\t]*ScriptAlias / | {print $3}'|sed 's/"//g'|sed 's/\/$//'` | export HTTPDCGI=`echo $HTTPDPCGI|awk '{print $1}'` | fi | | #echo "Detecta caracteristicas del Apache" | echo USR=$HTTPDUSER | echo GRP=$HTTPDGRP | #echo CONF=$HTTPDCONF | echo WEBDOC=$HTTPDROOT | echo WEBCGI=$HTTPDCGI | | if ! test $HTTPDUSER; then | echo "#EL APACHE NO TIENE USUARIO, estara apagado?, esto es | cpturado y no sale, arreglar" | fi
-- Marcos Guglielmetti - www.musix.org.ar | www.foros.musix.es | www.libraabedul.com
Musix en Chivilcoy: www.musix.org.ar/wiki/index.php/Musix_en_Chivilcoy#Fotos --- Decile NO! a la privatización de la educación en Argentina 0. "Plan de alfabetización digital en base a Software Libre" 1. Informate: http://educarsincadenas.com.ar 2. Te interesa? Unite a una lista de mail específica (Gleducar, etc.) www.educarsincadenas.org/ListasdeMail/ListasDeMail 3. Conocés alguien a quien pueda interesarle? Debemos llegar a los gremios docentes, no-docentes y centros de estudiantes --- Cómo asociarse a SOLAR (Software Libre Argentina) www.solar.org.ar/?breve78
_______________________________________________ Solar-general mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ---------------------------------------------------------------------- Aunque supiera que el mundo se acabará mañana, Igual plantaría mi manzano. -- Martin Luther King -- ----------------------------------------------------------------------