Skip to content

Commit 43f550e

Browse files
authored
Fix MOTD
1 parent 07a9a47 commit 43f550e

2 files changed

Lines changed: 36 additions & 31 deletions

File tree

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
#!/bin/bash
2-
3-
# Shell text formatting
4-
BOLD="$(tput bold)"
5-
NORMAL="$(tput sgr0)"
6-
7-
# Get system information
8-
HOSTNAME=$(hostname)
9-
IP=$(hostname -I | awk '{print $1}')
10-
UPTIME=$(uptime -p)
11-
DISK=$(df -h / | awk 'NR==2 {print $4}')
12-
MEMORY=$(free -h | awk 'NR==2 {print $7}')
13-
14-
# Print the MOTD
15-
echo "
16-
${BOLD}Welcome to EngineScript on ${HOSTNAME}${NORMAL}
17-
18-
${BOLD}System Information:${NORMAL}
19-
------------------
20-
${BOLD}IP Address:${NORMAL} ${IP}
21-
${BOLD}Uptime:${NORMAL} ${UPTIME}
22-
${BOLD}Disk Space:${NORMAL} ${DISK} available
23-
${BOLD}Memory:${NORMAL} ${MEMORY} available
24-
25-
${BOLD}EngineScript Commands:${NORMAL}
26-
--------------------
27-
${BOLD}es.menu${NORMAL} - Open EngineScript menu
28-
${BOLD}es.help${NORMAL} - Show all available EngineScript commands
29-
${BOLD}es.info${NORMAL} - Display server information
30-
${BOLD}es.backup${NORMAL} - Run backup
31-
${BOLD}es.update${NORMAL} - Update EngineScript
1+
#!/bin/bash
2+
3+
# Shell text formatting
4+
BOLD="$(tput bold 2>/dev/null || echo)"
5+
NORMAL="$(tput sgr0 2>/dev/null || echo)"
6+
7+
# Get system information
8+
HOSTNAME=$(hostname)
9+
IP=$(hostname -I | awk '{print $1}')
10+
UPTIME=$(uptime -p)
11+
DISK=$(df -h / | awk 'NR==2 {print $4}')
12+
MEMORY=$(free -h | awk 'NR==2 {print $7}')
13+
14+
# Print the MOTD
15+
echo "
16+
${BOLD}Welcome to EngineScript on ${HOSTNAME}${NORMAL}
17+
18+
${BOLD}System Information:${NORMAL}
19+
------------------
20+
${BOLD}IP Address:${NORMAL} ${IP}
21+
${BOLD}Uptime:${NORMAL} ${UPTIME}
22+
${BOLD}Disk Space:${NORMAL} ${DISK} available
23+
${BOLD}Memory:${NORMAL} ${MEMORY} available
24+
25+
${BOLD}EngineScript Commands:${NORMAL}
26+
--------------------
27+
${BOLD}es.menu${NORMAL} - Open EngineScript menu
28+
${BOLD}es.help${NORMAL} - Show all available EngineScript commands
29+
${BOLD}es.info${NORMAL} - Display server information
30+
${BOLD}es.backup${NORMAL} - Run backup
31+
${BOLD}es.update${NORMAL} - Update EngineScript
3232
"

setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ dpkg-reconfigure unattended-upgrades
152152
# Set MOTD
153153
cp -rf /usr/local/bin/enginescript/config/etc/update-motd.d/99-enginescript /etc/update-motd.d/99-enginescript
154154
chmod +x /etc/update-motd.d/99-enginescript
155+
chown root:root /etc/update-motd.d/99-enginescript
156+
dos2unix /etc/update-motd.d/99-enginescript
157+
# Test MOTD
158+
sudo run-parts --test /etc/update-motd.d/
159+
sudo run-parts /etc/update-motd.d/
155160

156161
# HWE
157162
apt install --install-recommends linux-generic-hwe-${UBUNTU_VERSION} -y

0 commit comments

Comments
 (0)