this is a not-so-easy problem of timing change includes a 'start_frappy' script, which gets port and cfg from the box config file. so install does no longer need to be executed when cfg or port is changed
21 lines
887 B
Bash
Executable File
21 lines
887 B
Bash
Executable File
export EDITOR=nano
|
|
echo "-----------------------------------------------------"
|
|
echo "Welcome to $HOSTNAME $(hostname -I)"
|
|
echo "ethernet addr $(cat /sys/class/net/eth0/address)"
|
|
function service_status () {
|
|
for name in $@; do \
|
|
enabled=$(systemctl is-enabled ${name} 2> /dev/null) && \
|
|
echo ${name} $(systemctl is-active ${name}) $enabled; \
|
|
done | column -t | grep --color=always '\(disabled\|inactive\|$\)' | nl -bn
|
|
}
|
|
function user_service_status () {
|
|
for name in $@; do \
|
|
enabled=$(systemctl --user is-enabled ${name} 2> /dev/null) && \
|
|
echo ${name} $(systemctl --user is-active ${name}) $enabled; \
|
|
done | column -t | grep --color=always '\(disabled\|inactive\|$\)' | nl -bn
|
|
}
|
|
alias current='cat /home/l_samenv/boxtools/current'
|
|
service_status router display
|
|
user_service_status frappy
|
|
echo "> current # show currently installed state"
|