Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. NAME="python /opt/voda/testtm.py"; [ -z "$(ps ax | grep "$NAME" | grep -v "grep")" ] && echo "процесс умер" || echo "процесс запущен"
  4.  
  5. foo() {
  6.     if [ -f /sys/devices/w1_bus_master1/w1_master_slaves ]; then
  7.         while read line; do
  8.             temp=$(grep "t=" /sys/devices/w1_bus_master1/$line/w1_slave| sed 's/^.*t=//')
  9.             echo -n "$line_$temp "
  10.         done < "/sys/devices/w1_bus_master1/w1_master_slaves"
  11.     else
  12.         echo "нет файла"
  13.     fi
  14. }
  15.  
  16. NAME="python /opt/voda/testtm.py"; [ -z "$(ps ax | grep "$NAME" | grep -v "grep")" ] && mon=1 || mon=0
  17. data=$(foo | sed's/ $//;s/ /,/')
  18. curl http://testsite.ru/w.php?mon=$mon&data=$data
  19. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement