update
This commit is contained in:
13
install.sh
13
install.sh
@@ -8,17 +8,15 @@ printm(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_green(){
|
print_green(){
|
||||||
tput setaf 2; echo "$1"
|
tput setaf 2; echo "$1"
|
||||||
tput sgr 0
|
tput sgr 0
|
||||||
}
|
}
|
||||||
|
|
||||||
print_yellow(){
|
print_yellow(){
|
||||||
tput setaf 3; printf "$1"
|
tput setaf 3; printf "$1"
|
||||||
tput sgr 0
|
tput sgr 0
|
||||||
}
|
}
|
||||||
|
|
||||||
printm "Raspberry Pi MQTT monitor installer"
|
|
||||||
|
|
||||||
check_and_install_pip(){
|
check_and_install_pip(){
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
python=$(which python)
|
python=$(which python)
|
||||||
@@ -80,7 +78,6 @@ set_cron(){
|
|||||||
print_yellow " If you want the cronjob to be automatically created remove the line below from your\n cronjobs list and run the installer again.\n\n"
|
print_yellow " If you want the cronjob to be automatically created remove the line below from your\n cronjobs list and run the installer again.\n\n"
|
||||||
echo " ${cronfound}"
|
echo " ${cronfound}"
|
||||||
else
|
else
|
||||||
|
|
||||||
printf "How often do you want the script to run in minutes? "
|
printf "How often do you want the script to run in minutes? "
|
||||||
read MIN
|
read MIN
|
||||||
echo "Adding the line below to your crontab"
|
echo "Adding the line below to your crontab"
|
||||||
@@ -88,11 +85,11 @@ set_cron(){
|
|||||||
echo "*/${MIN} * * * * ${python} ${cwd}/src/rpi-cpu2mqtt.py" >> tempcron
|
echo "*/${MIN} * * * * ${python} ${cwd}/src/rpi-cpu2mqtt.py" >> tempcron
|
||||||
crontab tempcron
|
crontab tempcron
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm tempcron
|
rm tempcron
|
||||||
}
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
|
printm "Raspberry Pi MQTT monitor installer"
|
||||||
check_and_install_pip
|
check_and_install_pip
|
||||||
install_requirements
|
install_requirements
|
||||||
update_config
|
update_config
|
||||||
|
|||||||
Reference in New Issue
Block a user