forked from AndyTaylorTweet/Pi-Star_Binaries_sbin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpistar-motdgen
executable file
·45 lines (38 loc) · 3.08 KB
/
pistar-motdgen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
##############################################################################
# #
# Pi-Star MOTD Generator. #
# #
# Version 0.9, Code, Design and Development by Andy Taylor (MW0MWZ). #
# #
# Make it simple to update the /etc/motd. #
# #
##############################################################################
#
# Make sure we are root, if we cant stop the services, the results are a bit hit and miss.
if [ "$(id -u)" != "0" ]; then
echo -e "You need to be root to run this command...\n"
exit 1
fi
# Get the Pi-Star Version Info
pistarCurVersion=$(awk -F "= " '/Version/ {print $2}' /etc/pistar-release)
sudo mount -o remount,rw /
echo -e "
[0;31m╔═══════════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██╗ ███████╗████████╗ █████╗ ██████╗ ║
║ ██╔══██╗██║ ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗ ██╗ ║
║ ██████╔╝██║█████╗███████╗ ██║ ███████║██████╔╝██████╗ ║
║ ██╔═══╝ ██║╚════╝╚════██║ ██║ ██╔══██║██╔══██╗╚═██╔═╝ ║
║ ██║ ██║ ███████║ ██║ ██║ ██║██║ ██║ ╚═╝ ║
║ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ║$(echo -e "$(cat /etc/motd-ext 2>/dev/null)")
║ ║
╚═══════════════════════════════════════════════════════════════════════╝
[0;0mThe Pi-Star Dashboard can be found at one of the following locations:
[1;32m http://$(hostname)/ http://$(hostname).local/ http://$(hostname -I | awk '{print $1}')/
[0;0mPi-Star's disk is read-only by default, enable read-write with \"rpi-rw\".
Pi-Star built by Andy Taylor (MW0MWZ), pi-star tools all start \"pistar-\".
[1;36mWelcome to Pi-Star+:[1;35m v${pistarCurVersion}
[0;0m" > /etc/motd
sudo touch /home/pi-star/$(hostname)