#!/bin/bash #Translation #export TEXTDOMAINDIR="/usr/share/locale" #export TEXTDOMAIN=biglinux-services # Don't group windows xprop -id "$(xprop -root '\t$0' _NET_ACTIVE_WINDOW | cut -f 2)" -f WM_CLASS 8s -set WM_CLASS "$$" Title=$"BigLinux Services" subTitleText=$"Ativar e Desativar Serviços" Service=$"Serviço:" Activate=$"Ativar" Disable=$"Desativar" windowsBarTitle=$"Titulo Janela" section=$"Sessão" help_Text=$"Texto esplicativo" Need_Help=$"Precisa de ajuda?" CLOSE=$"Fechar" OPEN=$"Abrir" Ativado_text=$"Ativado" Desativado_text=$"Desativado" cat << EOF
EOF # Get body tag with color light or not /usr/share/bigbashview/bcc/shell/getbgcolor.sh cat << EOF

## $Title

### $subTitleText

Boot | Start
EOF lista_service=$(grep "() {" index.sh.htm | awk '{print $1}' | sed '/lista_service=/d') ### Inicio Editavel ### ### Inicio Editavel ### ### Inicio Editavel ### apache () { service_name="Apache" SERVICE="httpd" } ngnix () { service_name="Ngnix" SERVICE="ngnix" } mysql () { service_name="MySQL" SERVICE="mysql" } php () { service_name="PHP" SERVICE="php8" } docker () { service_name="Docker" SERVICE="docker" } ssh () { service_name="SSH" SERVICE="sshd" } ### Fim Editavel ### ### Fim Editavel ### ### Fim Editavel ### for i in ${lista_service[@]}; do $i; if [ -n "$(systemctl status $SERVICE | grep "Loaded:")" ];then start=$(LANG=C systemctl status $SERVICE | grep Active: | awk '{print $2}') if [ "$start" = "active" ]; then checked_start="checked" else checked_start= fi enable=$(LANG=C systemctl status $SERVICE | grep Loaded: | awk '{print $4}' | sed 's/;//') if [ "$enable" = "enabled" ]; then checked_enable="checked" else checked_enable= fi cat << EOF

- $service_name
  EOF if [ "$checked_start" = "checked" ]; then cat << EOF $Ativado_text

EOF else cat << EOF $Desativado_text
EOF fi fi done ### End ### cat << EOF
EOF cat << EOF
EOF