2023-03-20 02:34:49 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source .env
|
|
|
|
|
|
|
|
ventilator=$1
|
|
|
|
|
|
|
|
if [[ ! $ventilator ]]; then
|
2023-03-21 03:31:20 +01:00
|
|
|
echo "Izberi ventilator (1 ali 2 kot parameter; 3 za oba ter 0 za izklop)"
|
2023-03-20 02:34:49 +01:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-03-21 03:31:20 +01:00
|
|
|
if [[ $ventilator = 1 ]]; then
|
|
|
|
url="$VIR/cm?cmnd=PojdiLevo%202000"
|
|
|
|
elif [[ $ventilator = 2 ]]; then
|
|
|
|
url="$VIR/cm?cmnd=PojdiDesno%202000"
|
|
|
|
elif [[ $ventilator = 3 ]]; then
|
|
|
|
url="$VIR/cm?cmnd=PojdiRavno%202000"
|
|
|
|
elif [[ $ventilator = 0 ]]; then
|
|
|
|
url="$VIR/cm?cmnd=UgasniVse"
|
|
|
|
else
|
|
|
|
echo "Izbrana možnost ($ventilator) je neveljavna"
|
|
|
|
fi
|
2023-03-20 02:34:49 +01:00
|
|
|
|
|
|
|
curl "$url"
|