galerija-bot/2_vent_vklop.sh

25 lines
515 B
Bash
Executable File

#!/bin/bash
source .env
ventilator=$1
if [[ ! $ventilator ]]; then
echo "Izberi ventilator (1 ali 2 kot parameter; 3 za oba ter 0 za izklop)"
exit 0
fi
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
curl "$url"