Skip to content

Commit f96e7c3

Browse files
committed
Update update-nodejs-and-nodered
1 parent a2f1617 commit f96e7c3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

deb/update-nodejs-and-nodered

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -692,15 +692,18 @@ case $yn in
692692
if $SUDO grep -q Raspberry /proc/cpuinfo; then
693693
# $SUDO setcap cap_net_raw+eip $(eval readlink -f `which node`) 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
694694
$SUDO adduser $NODERED_USER gpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
695+
FAM=$(cat /etc/issue | cut -d ' ' -f 1)
695696
ISS=$(cat /etc/issue | cut -d '/' -f 2 | cut -d ' ' -f 2)
696-
if (($ISS > 11)); then
697-
echo "Replace old rpi.gpio with lgpio" | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
698-
$SUDO apt purge -y python3-rpi.gpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
699-
$SUDO apt install -y python3-pip 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
700-
$SUDO pip3 install --break-system-packages rpi-lgpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
701-
else
702-
echo "Leaving old rpi.gpio" | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
703-
$SUDO apt install -y python3-rpi.gpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
697+
if [[ "$FAM" == "Raspbian" ]]; then
698+
if (($ISS > 11)); then
699+
echo "Replace old rpi.gpio with lgpio" | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
700+
$SUDO apt purge -y python3-rpi.gpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
701+
$SUDO apt install -y python3-pip 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
702+
$SUDO pip3 install --break-system-packages rpi-lgpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
703+
else
704+
echo "Leaving old rpi.gpio" | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
705+
$SUDO apt install -y python3-rpi.gpio 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null
706+
fi
704707
fi
705708
fi
706709
$SUDO setcap cap_net_raw=ep /bin/ping 2>&1 | $SUDO tee -a /var/log/nodered-install.log >>/dev/null

0 commit comments

Comments
 (0)