mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 22:58:43 +01:00
Merge pull request #970 from frennkie/fix-rtl
add check and install for python2
This commit is contained in:
commit
d67e8c1cdd
2 changed files with 21 additions and 7 deletions
|
@ -16,8 +16,9 @@ fi
|
|||
|
||||
# check if nodeJS was installed
|
||||
nodeJSInstalled=$(node -v 2>/dev/null | grep -c "v1.")
|
||||
if [ ${nodeJSInstalled} -eq 0 ]; then
|
||||
|
||||
if ! [ ${nodeJSInstalled} -eq 0 ]; then
|
||||
echo "nodeJS is already installed"
|
||||
else
|
||||
# determine nodeJS VERSION and DISTRO
|
||||
echo "Detect CPU architecture ..."
|
||||
isARM=$(uname -m | grep -c 'arm')
|
||||
|
@ -89,8 +90,6 @@ if [ ${nodeJSInstalled} -eq 0 ]; then
|
|||
echo "ABORT - nodeJs install"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "nodeJS is already installed"
|
||||
fi
|
||||
|
||||
# setting value in raspi blitz config
|
||||
|
|
|
@ -32,11 +32,23 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
echo "*** INSTALL RTL ***"
|
||||
|
||||
isInstalled=$(sudo ls /etc/systemd/system/RTL.service 2>/dev/null | grep -c 'RTL.service')
|
||||
if [ ${isInstalled} -eq 0 ]; then
|
||||
if ! [ ${isInstalled} -eq 0 ]; then
|
||||
echo "RTL already installed."
|
||||
|
||||
else
|
||||
# check and install NodeJS
|
||||
/home/admin/config.scripts/bonus.nodejs.sh
|
||||
|
||||
# check for Python2 (install if missing)
|
||||
# TODO remove Python2 ASAP!
|
||||
echo "*** Check for Python2 ***"
|
||||
/usr/bin/which python2 &>/dev/null
|
||||
if ! [ $? -eq 0 ]; then
|
||||
echo "*** Install Python2 ***"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python2
|
||||
fi
|
||||
|
||||
# download source code and set to tag release
|
||||
echo "*** Get the RTL Source Code ***"
|
||||
rm -r /home/admin/RTL 2>/dev/null
|
||||
|
@ -71,6 +83,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
fi
|
||||
echo ""
|
||||
|
||||
# now remove Python2 again
|
||||
echo "*** Now remove Python2 again ***"
|
||||
sudo apt-get purge -y python2
|
||||
sudo apt-get autoremove -y
|
||||
|
||||
# prepare RTL.conf file
|
||||
echo "*** RTL.conf ***"
|
||||
cp ./RTL/sample-RTL.conf ./RTL/RTL.conf
|
||||
|
@ -93,8 +110,6 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
sudo systemctl enable RTL
|
||||
echo "OK - the RTL service is now enabled"
|
||||
|
||||
else
|
||||
echo "RTL already installed."
|
||||
fi
|
||||
|
||||
# setting value in raspi blitz config
|
||||
|
|
Loading…
Add table
Reference in a new issue