Improve installation process (#120)
This commit is contained in:
13
install.sh
13
install.sh
@@ -1,14 +1,3 @@
|
|||||||
welcome(){
|
|
||||||
echo " This script will install if not installed: python-pip and python module paho-mqtt,"
|
|
||||||
echo " configure Raspberry Pi MQTT monitor and create a cronjob to run it."
|
|
||||||
read -r -p " Do you want to proceed? [y/N] " response
|
|
||||||
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|
||||||
printf ""
|
|
||||||
else
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
find_python(){
|
find_python(){
|
||||||
if [[ $(python3 --version) ]]; then
|
if [[ $(python3 --version) ]]; then
|
||||||
python=$(which python3)
|
python=$(which python3)
|
||||||
@@ -215,8 +204,6 @@ create_shortcut(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
printm "Raspberry Pi MQTT Monitor installer"
|
|
||||||
welcome
|
|
||||||
find_python
|
find_python
|
||||||
check_and_install_pip
|
check_and_install_pip
|
||||||
create_venv
|
create_venv
|
||||||
|
|||||||
@@ -8,7 +8,20 @@ printm(){
|
|||||||
printf -- '-%.0s' $(seq $length); echo ""
|
printf -- '-%.0s' $(seq $length); echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
welcome(){
|
||||||
|
printm "Raspberry Pi MQTT Monitor installer"
|
||||||
|
echo "Welcome to the Raspberry Pi MQTT Monitor installer."
|
||||||
|
echo "This script will install necessary components, configure the monitor and set up a cron job or service."
|
||||||
|
read -r -p "Ready to proceed? [y/N] " response
|
||||||
|
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||||
|
printf ""
|
||||||
|
else
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main(){
|
main(){
|
||||||
|
welcome
|
||||||
if [[ $(git --version) ]]; then
|
if [[ $(git --version) ]]; then
|
||||||
git=$(which git)
|
git=$(which git)
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user