# Probleme script bash

**URL:** <https://www.debian-fr.org/t/probleme-script-bash/72900>\
**Category:** Programmation\
**Created:** [Mars 8, 2017, 12:38 UTC](https://www.debian-fr.org/t/probleme-script-bash/72900 "2017-03-08T00:38:29Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Hector](https://www.debian-fr.org/user_avatar/www.debian-fr.org/hector/32/5301_2.png) [@Hector](https://www.debian-fr.org/u/Hector)\
**Post date:** [Mars 8, 2017, 8:25 UTC](https://www.debian-fr.org/t/probleme-script-bash/72900/5 "2017-03-08T20:25:12Z")

</div>

hop! 😉

ca marche avec et sans couleurs niquel, pour l’intégration des celle ci dans conky avoir cette nuit mais conky est en bash et les codes couleurs sont les memes a voir.

après j’ai pas compris ont est 3 sur la discustion mais je ne vois que @dindoun et moi (hector)  
hors je veux bien etre fou mais pas skyzo, comment hector peut repondre a hector donc a moi en locurrence?

```auto
#!/bin/bash

SERVICES_NAME[53]="Unbound"
SERVICES_HOST[53]="localhost"
 
SERVICES_NAME[218]="Dnscrypt"
SERVICES_HOST[218]="localhost"
 
SERVICES_NAME[80]="SSH"
SERVICES_HOST[80]="localhost"
 
SERVICES_NAME[3306]="VPN"
SERVICES_HOST[3306]="localhost"

 
# Function : services
function services()
{
   
      for PORT in "${!SERVICES_NAME[@]}"
    do
        NAME=${SERVICES_NAME[$PORT]}
        HOST=${SERVICES_HOST[$PORT]}
 
        CHECK=`(exec 3<>/dev/tcp/$HOST/$PORT) &>/dev/null; echo $?`
 
        if [$CHECK = 0] ; then
            CHECK_LABEL=ONLINE
        else
            CHECK_LABEL=OFFLINE
        fi
 
        echo "${CHECK_LABEL}"
    done
}
  services

```

---

_[View the full topic](https://www.debian-fr.org/t/probleme-script-bash/72900)._
