no, your script is fine:
#!bin/bash
#this reverts HG back to the homegenie_1.2-stable.34 build
cd
sudo systemctl stop homegenie.service
sudo systemctl disable homegenie.service
sudo rm -r /var/run/systemd/generator.late/homegenie.service
sudo dpkg --remove homegenie
if [ -f homegenie/HomeGenie.exe ] then
sudo rm -r homegenie
else
sudo rm -r /usr/local/bin/homegenie
fi
sudo wget
https://github.com/genielabs/HomeGenie/releases/download/v1.2-stable.34/homegenie_1.2-stable.34_all.debsudo gdebi homegenie_1.2-stable.34_all.deb
echo " HomeGenie 1.2-stable.34 is now installed please reboot"
I just tried to reinstall and failed miserably:
pi@X10Hub:/usr/local/bin $ pi@X10Hub:~ $ fi
-bash: pi@X10Hub:~: command not found
pi@X10Hub:/usr/local/bin $ -bash: syntax error near unexpected token `fi'
> pi@X10Hub:~ $ cd /usr
> pi@X10Hub:/usr $ cd local/bin
> pi@X10Hub:/usr/local/bin $ dir
> pi@X10Hub:/usr/local/bin $ cd ..
> pi@X10Hub:/usr/local $ chown pi:pi bin
> chown: changing ownership of 'bin': Operation not permitted
> pi@X10Hub:/usr/local $ sudo chown pi:pi bin
> pi@X10Hub:/usr/local $ cd bin
> pi@X10Hub:/usr/local/bin $ sh Revert-reinstall_HG
> --2019-03-11 15:23:53--
https://github.com/genielabs/HomeGenie/releases/download/v1.2-stable.34/homegenie_1.2-stable.34_all.deb%0D> Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
> Connecting to github.com (github.com)|192.30.253.113|:443... connected.
> HTTP request sent, awaiting response... 404 Not Found
> 20SCP19-03-11 15:23:53 ERROR 404: Not Found.
>
> gdebi error, file not found: homegenie_1.2-stable.34_all.deb
> HomeGenie 1.2-stable.34 is now installed please reboot
> : not foundstall_HG: 4: Revert-reinstall_HG:
> pi@X10Hub:/usr/local/bin $
>
Not sure what a "fi" command is...
winSCP would not allow me to copy my program to this usr/local/bin dir as it was owned by root, so I changed that, copied my new program Revert-reinstall_HG to that directory:
sudo wget
https://github.com/genielabs/HomeGenie/releases/download/v1.2-stable.34/homegenie_1.2-stable.34_all.debsudo gdebi homegenie_1.2-stable.34_all.deb
echo " HomeGenie 1.2-stable.34 is now installed please reboot"
running it gave Result that was less than pleasing:
pi@X10Hub:/usr/local/bin $ sh Revert-reinstall_HG
--2019-03-11 15:30:52--
https://github.com/genielabs/HomeGenie/releases/download/v1.2-stable.34/homegenie_1.2-stable.34_all.deb%0DResolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2019-03-11 15:30:52 ERROR 404: Not Found.
gdebi error, file not found: homegenie_1.2-stable.34_all.deb
HomeGenie 1.2-stable.34 is now installed please reboot
: not foundstall_HG: 4: Revert-reinstall_HG:
Quit for now.