-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add emonpi bash-rw-inidcator and motd
- Loading branch information
1 parent
c3bee09
commit c21e61c
Showing
4 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
# emonPi bash RW / RO prompt | ||
# Thanks to Andy Taylor: https://community.openenergymonitor.org/t/increase-emonsd-pre-built-sd-ca$ | ||
|
||
set_bash_prompt(){ | ||
fs_mode=$(mount | sed -n -e "s/^\/dev\/mmcblk0p2 on \/ .*(\(r[w|o]\).*/\1/p") | ||
|
||
if [ $(id -u) -eq 0 ]; | ||
then | ||
PS1='\[\033[01;31m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ | ||
else | ||
PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ | ||
fi | ||
} | ||
|
||
# setup fancy prompt | ||
PROMPT_COMMAND=set_bash_prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
The programs included with the Debian GNU/Linux system are free software; | ||
the exact distribution terms for each program are described in the | ||
individual files in /usr/share/doc/*/copyright. | ||
|
||
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
permitted by applicable law. | ||
|
||
Welcome to emonPi shell. The file system is in Read Only (RO) mode. If you need to make changes, | ||
use the command 'rpi-rw' to put the file system in Read Write (RW) mode. | ||
Use 'rpi-ro' to return to RO mode. The /home/pi/data directory is always in RW mode. | ||
|