Project

General

Profile

relay_toggle.sh

wurmi, 01/05/2017 08:29 PM

 
1
#!/bin/bash
2
#Relaykarte sainsmart  mit Argumenten
3
#Stand 04.01.2017
4

    
5
#echo $(printf "%02d" $((($1-1)*2)))
6
#echo $(printf "%02d" $((($1-1)*2+1)))
7

    
8
if [$1 == "all"];
9
then
10
  sudo wget http://192.168.0.50/3000/45
11
  sleep 1
12
  sudo wget http://192.168.0.50/3000/44
13
fi
14

    
15
sudo wget http://192.168.0.50/3000/$(printf "%02d" $((($1-1)*2+1)))
16
sleep 0.5
17
sudo wget http://192.168.0.50/3000/$(printf "%02d" $((($1-1)*2)))
18

    
19

    
20

    
21

    
22

    
23
#wget http://192.168.0.50/3000/00
24
#sleep 1
25
#wget http://192.168.0.50/3000/01