User Tools

Site Tools


средства_программирования_shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
средства_программирования_shell [2024/03/06 18:12]
val [Целочисленный цикл (поиск хостов в подсети)]
средства_программирования_shell [2024/04/11 12:41] (current)
val [Web сервер на shell]
Line 94: Line 94:
 do do
   test $i = 50 && continue   test $i = 50 && continue
-  ping -c 1 -W 1 $1.$i > /dev/null 2>&1 && echo $1.$i+  ping -c 1 -W 1 $1.$i > /dev/null 2>&1 && echo $1.$i || echo No $i
   i=$(($i + 1))   i=$(($i + 1))
 done done
Line 417: Line 417:
 #  echo `date` OK $filename on `hostname` >> $log #  echo `date` OK $filename on `hostname` >> $log
   echo -e "​HTTP/​1.1 200 OK\r"   echo -e "​HTTP/​1.1 200 OK\r"
-  echo -e "​Content-Type:​ $(/​usr/​bin/​file -bi \"$filename\")\r"+  echo -e "​Content-Type:​ $(/​usr/​bin/​file -bi $filename)\r"​
   echo -e "​\r"​   echo -e "​\r"​
   /bin/cat "​$filename"​   /bin/cat "​$filename"​
 else else
-#  echo "​$(date)"​ ERR $filename on "​$(hostname)"​ >> $log+#  echo "​$(date)"​ ERR $filename on "​$(hostname)"​ >> ​"$log"
   echo -e "​HTTP/​1.1 404 Not Found\r"​   echo -e "​HTTP/​1.1 404 Not Found\r"​
   echo -e "​Content-Type:​ text/​html;​\r"​   echo -e "​Content-Type:​ text/​html;​\r"​
средства_программирования_shell.1709737922.txt.gz · Last modified: 2024/03/06 18:12 by val