fff-support: Add device name and firmware version to MOTD

Submitted by Adrian Schmutzler on April 23, 2019, 2:27 p.m.

Details

Message ID 20190423142740.6188-1-freifunk@adrianschmutzler.de
State Accepted
Headers show

Commit Message

Adrian Schmutzler April 23, 2019, 2:27 p.m.
This adds a line containing the device name and the current
firmware version to the MOTD shown after logging in via SSH, e.g.

> TP-Link TL-WR1043N/ND v2 @ jubtl9_20190320

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

I consider this very convenient myself, maybe others are also
interested.
---
 src/packages/fff/fff-support/Makefile                            | 2 +-
 .../fff/fff-support/files/etc/uci-defaults/80-banner-info        | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-support/Makefile b/src/packages/fff/fff-support/Makefile
index 56e35740..2fc74b0c 100644
--- a/src/packages/fff/fff-support/Makefile
+++ b/src/packages/fff/fff-support/Makefile
@@ -1,7 +1,7 @@ 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-support
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info b/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info
new file mode 100644
index 00000000..5ffef084
--- /dev/null
+++ b/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info
@@ -0,0 +1,9 @@ 
+#!/bin/sh
+# Copyright 2018 Adrian Schmutzler
+# License GPLv3
+
+. /etc/firmware_release
+
+echo "" >> /etc/banner
+echo "> $(cat /tmp/sysinfo/model 2>/dev/null) @ $FIRMWARE_VERSION" >> /etc/banner
+echo "" >> /etc/banner

Comments

Fabian Blaese May 25, 2019, 5:51 p.m.
Kann man denke ich so machen. Ich würde aber die Leerzeilen weglassen.

Reviewed-by: Fabian Bläse <fabian@blaese.de>

Fabian

On 23.04.19 16:27, Adrian Schmutzler wrote:
> This adds a line containing the device name and the current
> firmware version to the MOTD shown after logging in via SSH, e.g.
> 
>> TP-Link TL-WR1043N/ND v2 @ jubtl9_20190320
> 
> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
> 
> ---
> 
> I consider this very convenient myself, maybe others are also
> interested.
> ---
>  src/packages/fff/fff-support/Makefile                            | 2 +-
>  .../fff/fff-support/files/etc/uci-defaults/80-banner-info        | 9 +++++++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
>  create mode 100644 src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info
> 
> diff --git a/src/packages/fff/fff-support/Makefile b/src/packages/fff/fff-support/Makefile
> index 56e35740..2fc74b0c 100644
> --- a/src/packages/fff/fff-support/Makefile
> +++ b/src/packages/fff/fff-support/Makefile
> @@ -1,7 +1,7 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=fff-support
> -PKG_RELEASE:=2
> +PKG_RELEASE:=3
>  
>  PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
>  
> diff --git a/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info b/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info
> new file mode 100644
> index 00000000..5ffef084
> --- /dev/null
> +++ b/src/packages/fff/fff-support/files/etc/uci-defaults/80-banner-info
> @@ -0,0 +1,9 @@
> +#!/bin/sh
> +# Copyright 2018 Adrian Schmutzler
> +# License GPLv3
> +
> +. /etc/firmware_release
> +
> +echo "" >> /etc/banner
> +echo "> $(cat /tmp/sysinfo/model 2>/dev/null) @ $FIRMWARE_VERSION" >> /etc/banner
> +echo "" >> /etc/banner
>
Fabian Blaese July 22, 2019, 8:57 p.m.
Von Adrian applied.