This commit is contained in:
hjelev
2022-03-19 01:15:07 +02:00
parent 9b665d3384
commit e2df649311

View File

@@ -17,8 +17,6 @@ print_yellow(){
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