From 14bc088c6bb0b0f51ea9aa30b458b8bc4041043b Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Wed, 20 Sep 2023 08:55:48 +0200 Subject: [PATCH] motd: If there are any major changes, I can now edit MOTD! Signed-off-by: Jeroen Oudshoorn --- builder/data/etc/motd | 27 ---------------------- builder/data/etc/update-motd.d/motd.sh | 31 ++++++++++++++++++++++++++ builder/pwnagotchi.yml | 4 ++-- 3 files changed, 33 insertions(+), 29 deletions(-) delete mode 100644 builder/data/etc/motd create mode 100644 builder/data/etc/update-motd.d/motd.sh diff --git a/builder/data/etc/motd b/builder/data/etc/motd deleted file mode 100644 index 4ce19a1e..00000000 --- a/builder/data/etc/motd +++ /dev/null @@ -1,27 +0,0 @@ -(◕‿‿◕) {{pwnagotchi.hostname}} - - Hi! I'm a pwnagotchi {{pwnagotchi.version}}, please take good care of me! - Here are some basic things you need to know to raise me properly! - - If you want to change my configuration, use /etc/pwnagotchi/config.toml - - All the configuration options can be found on /etc/pwnagotchi/default.toml, - but don't change this file because I will recreate it every time I'm restarted! - - I use oPwnGrid as my main API, you can check stats at https://opwngrid.xyz - - I'm managed by systemd. Here are some basic commands. - - If you want to know what I'm doing, you can check my logs with the command - - pwnlog - - pwnver, to check the current version - - sudo pwnagotchi --donate, to see how you can donate to this project - - sudo pwnagotchi --check-update, to see if there is a new version available - - If you want to know if I'm running, you can use - systemctl status pwnagotchi - - You can restart me using - systemctl restart pwnagotchi - - You learn more about me at https://pwnagotchi.ai/ \ No newline at end of file diff --git a/builder/data/etc/update-motd.d/motd.sh b/builder/data/etc/update-motd.d/motd.sh new file mode 100644 index 00000000..272d122f --- /dev/null +++ b/builder/data/etc/update-motd.d/motd.sh @@ -0,0 +1,31 @@ +#!/bin/sh +_hostname=$(hostname) +_version=$(shell cut -d"'" -f2 < /usr/local/lib/python3.9/dist-packages/pwnagotchi/_version.py) + +echo "(◕‿‿◕) $_hostname" +echo"" +echo" Hi! I'm a pwnagotchi $_version, please take good care of me!" +echo" Here are some basic things you need to know to raise me properly!" +echo"" +echo" If you want to change my configuration, use /etc/pwnagotchi/config.toml" +echo" " +echo" All the configuration options can be found on /etc/pwnagotchi/default.toml," +echo" but don't change this file because I will recreate it every time I'm restarted!" +echo"" +echo" I use oPwnGrid as my main API, you can check stats at https://opwngrid.xyz" +echo"" +echo" I'm managed by systemd. Here are some basic commands." +echo"" +echo" If you want to know what I'm doing, you can check my logs with the command" +echo" - pwnlog" +echo" - pwnver, to check the current version" +echo" - sudo pwnagotchi --donate, to see how you can donate to this project" +echo" - sudo pwnagotchi --check-update, to see if there is a new version available" +echo"" +echo" If you want to know if I'm running, you can use" +echo" systemctl status pwnagotchi" +echo"" +echo" You can restart me using" +echo" systemctl restart pwnagotchi" +echo"" +echo" You learn more about me at https://pwnagotchi.ai/" \ No newline at end of file diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 4ed9eac5..372b68ba 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -489,10 +489,10 @@ regexp: '(.*)$' line: '\1 modules-load=dwc2,g_ether' - - name: configure motd + - name: configure motd.sh become_user: root copy: - dest: /etc/motd + dest: /etc/motd.sh content: | (◕‿‿◕) {{pwnagotchi.hostname}}