Skip to content

Commit

Permalink
Suppress UX courtesy reminders on non-interactive shells (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrund authored Dec 24, 2023
1 parent 95f3152 commit 2b0bab7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions setup/pi/setup-teslausb
Original file line number Diff line number Diff line change
Expand Up @@ -918,11 +918,13 @@ sed -i '/source \/root\/bin\/setup-teslausb/d' /root/.bashrc
if ! grep -q TESLAUSB_TIP1 /root/.bashrc
then
cat >> /root/.bashrc <<- EOC
cat << TESLAUSB_TIP1
Run 'bin/setup-teslausb upgrade' to update to the latest version of teslausb,
or run 'bin/remountfs_rw' to allow writing to the root partition.
if [ -n "\$PS1" ]; then
cat << TESLAUSB_TIP1
Run 'bin/setup-teslausb upgrade' to update to the latest version of teslausb,
or run 'bin/remountfs_rw' to allow writing to the root partition.
TESLAUSB_TIP1
TESLAUSB_TIP1
fi
EOC
fi

Expand All @@ -932,10 +934,12 @@ then
if ! grep -q TESLAUSB_TIP1 "/home/$DEFUSER/.bashrc"
then
cat >> "/home/$DEFUSER/.bashrc" <<- EOC
cat << TESLAUSB_TIP1
Run 'sudo -i' if you need to make changes.
if [ -n "\$PS1" ]; then
cat << TESLAUSB_TIP1
Run 'sudo -i' if you need to make changes.
TESLAUSB_TIP1
TESLAUSB_TIP1
fi
EOC
fi
fi
Expand Down

0 comments on commit 2b0bab7

Please sign in to comment.