1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00

templates/iiab-remoteit: Warn if /etc/remoteit/config.json exists...and try it?

This commit is contained in:
A Holt 2022-04-18 09:55:35 -04:00 committed by GitHub
parent e142ca6af0
commit 70cc74ac47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,28 @@ fi
echo -e "\nThis IIAB must be online to begin!\n"
if [ -f /etc/remoteit/config.json ]; then
echo -en "For fresh registration let's remove /etc/remoteit/config.json, Ok? [Y/n] "
read -n 1 -r ans < /dev/tty # Prompt for a single character
echo; echo
if [[ $ans != "y" && $ans != "Y" ]]; then
echo -e "Let's try to enable remote.it, with your existing /etc/remoteit/config.json...\n"
systemctl enable connectd
systemctl restart connectd
systemctl enable schannel
if grep -q '^remoteit_enabled:' /etc/iiab/local_vars.yml; then
sed -i "s/^remoteit_enabled:.*/remoteit_enabled: True/" /etc/iiab/local_vars.yml
else
echo "remoteit_enabled: True" >> /etc/iiab/local_vars.yml
fi
exit 0
fi
fi
echo -en "\e[1mOptionally purge + install latest remote.it Device Package? [y/N]\e[0m "
read -n 1 -r ans < /dev/tty # Prompt for a single character
echo; echo