403Webshell
Server IP : 104.129.129.72  /  Your IP : 216.73.216.229
Web Server : LiteSpeed
System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
User : answe8064 ( 1002)
PHP Version : 8.2.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /opt/installer/tweaks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/installer/tweaks/motd-sysinfo
#!/bin/bash

if [ -f "include/startup.sh" ]; then
    . include/startup.sh
elif [ -f "../include/startup.sh" ]; then
    . ../include/startup.sh
fi

installPackage update-motd | log
waitOrStop 0 "Failed apt install: update-motd"

rootDir=$(rootDir)

echo "#!/bin/sh" > /etc/update-motd.d/97-sysinfo
echo "cat << EOF " >> /etc/update-motd.d/97-sysinfo
cat << EOF >> /etc/update-motd.d/97-sysinfo

=== System Info ==============================================================

  CPU: \`grep -c ^processor /proc/cpuinfo\` Cores of\`cat /proc/cpuinfo | grep 'model name' | head -1 | cut -d':' -f2\`
  RAM: \`free -m | head -n 2 | tail -n 1 | awk {'print \$3'}\`MiB / \`free -m | head -n 2 | tail -n 1 | awk {'print \$2'}\`MiB
  Swap Usage: \`free -m | tail -n 1 | awk {'print \$3'}\`MiB / \`free -m | tail -n 1 | awk {'print \$2'}\`MiB
  Disk Usage of /: \`df -h / | awk '{ a = \$3 } END { print a }'\`iB / \`df -h / | awk '{ a = \$2 } END { print a }'\`iB

  \`uptime -p\` since \`uptime -s\`
  \`ps aux --no-heading | wc -l\` running processes
  System load: \`cat /proc/loadavg | awk '{print \$1 ", " \$2 ", " \$3}'\`

EOF
echo "EOF" >> /etc/update-motd.d/97-sysinfo

chmod +x /etc/update-motd.d/97-sysinfo

update-motd

exit 0

tagScript success

Youez - 2016 - github.com/yon3zu
LinuXploit