From af1be87365fcaf5ecf9d7dd4e56456f04bab0b66 Mon Sep 17 00:00:00 2001 From: LIN SE Date: Wed, 29 Jun 2022 11:29:21 +0200 Subject: [PATCH] show state of router and frappy service at welcome --- to_system/etc/profile.d/welcome.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/to_system/etc/profile.d/welcome.sh b/to_system/etc/profile.d/welcome.sh index 7ea343f..421c75c 100755 --- a/to_system/etc/profile.d/welcome.sh +++ b/to_system/etc/profile.d/welcome.sh @@ -1,3 +1,9 @@ echo "Welcome to $HOSTNAME $(hostname -I)" echo "$(cat /sys/class/net/enp4s0/address)" export EDITOR=nano +function service_status () { + for name in $@; do \ + echo ${name} $(systemctl is-active ${name}) $(systemctl is-enabled ${name}); \ + done | column -t | grep --color=always '\(disabled\|inactive\|$\)' +} +service_status router frappy