aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/tools/sysinfo.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
committerJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
commit7e95c3b667a1b353f8275db886203f272bfcce34 (patch)
treeaefe3b7db69ac78b83b79a70cf43401679812d20 /hyperterm/tools/sysinfo.sh
downloadhyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.lz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.xz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.zip
first commit
Diffstat (limited to 'hyperterm/tools/sysinfo.sh')
-rw-r--r--hyperterm/tools/sysinfo.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/hyperterm/tools/sysinfo.sh b/hyperterm/tools/sysinfo.sh
new file mode 100644
index 0000000..5a51168
--- /dev/null
+++ b/hyperterm/tools/sysinfo.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# System information
+function ii() {
+
+ my_ip "$1" &> /dev/null
+
+ case ${LANG/_*/} in
+ es)
+ printf '%s\e[1;36m%s\e[m\n' "Has iniciado sesión en " "$(hostname -f)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Información adicional:" "$(uname -a)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Usuarios Conectados:" "$(who -u)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Fecha actual:" "$(date)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Estadísticas de la máquina:" "$(uptime)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Estadísticas de la memoria:" "$(free)"
+ printf '\n\e[1;32m%s\e[m\n' "Dirección IP Local:"
+ printf '%s\n' "${MY_IP:-"No conectado"}"
+ my_isp "$1" &> /dev/null
+ printf '\n\e[1;32m%s\e[m\n' "Dirección ISP:"
+ printf '%s\n' "${MY_ISP:-"No conectado"}"
+ ;;
+ *)
+ printf '%s\e[1;36m%s\e[m\n' "You are logged on " "$(hostname -f)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Additionnal information:" "$(uname -a)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Users logged:" "$(who -u)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Current date:" "$(date)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Machine stats:" "$(uptime)"
+ printf '\n\e[1;32m%s\e[m\n%s\n' "Memory stats:" "$(free)"
+ printf '\n\e[1;32m%s\e[m\n' "Local IP Address:"
+ printf '%s\n' "${MY_IP:-"Not connected"}"
+ my_isp "$1" &> /dev/null
+ printf '\n\e[1;32m%s\e[m\n' "ISP Address:"
+ printf '%s\n' "${MY_ISP:-"Not connected"}"
+ ;;
+ esac
+}