Skip to content

Commit ea7645d

Browse files
committed
test if legacy code is actually needed
1 parent 9646ae0 commit ea7645d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

install_rubikpi3.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ apt-get update -y
1515

1616

1717
# TODO: Remove legacy
18-
sed -i "/$HOST_ENTRY/d" /etc/hosts || true
19-
sed -i '/apt.rubikpi.ai ppa main/d' /etc/apt/sources.list || true
18+
if grep -q "$HOST_ENTRY" /etc/hosts; then
19+
echo "Removing legacy host entry from /etc/hosts"
20+
sed -i "/$HOST_ENTRY/d" /etc/hosts
21+
fi
22+
23+
if grep -q "apt.rubikpi.ai ppa main" /etc/apt/sources.list; then
24+
echo "Removing legacy repo entry from /etc/apt/sources.list"
25+
sed -i '/apt.rubikpi.ai ppa main/d' /etc/apt/sources.list
26+
fi
2027

2128
if ! grep -q "^[^#]*$REPO_ENTRY" /etc/apt/sources.list; then
2229
echo "$REPO_ENTRY" | tee -a /etc/apt/sources.list >/dev/null

0 commit comments

Comments
 (0)