User talk:Rsepp: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Rsepp (talk | contribs)
Created page with '<source lang="bash"> #!/bin/bash #Autor: Rene Sepp A21 #Skript kontrollib, kas Ubuntu serveris on seadistatud etteantud IP alias IP=$1 #Õiguste kontroll if [ $UID -ne 0 ]; the…'
 
Rsepp (talk | contribs)
Blanked the page
Line 1: Line 1:
<source lang="bash">
#!/bin/bash
#Autor: Rene Sepp A21
#Skript kontrollib, kas Ubuntu serveris on seadistatud etteantud IP alias


IP=$1
#Õiguste kontroll
if [ $UID -ne 0 ]; then
echo "Käivita skript $(basename $0) rootkasutaja õigustega"
exit 1
fi
#Kontroll kas IP on parameetrina antud
if [ $# -ne 1 ]; then
        echo "Käivita skript $(basename $0) koos IPga"
        exit 1
fi
#Otsib failist '/etc/network/interfaces' argumendis antud IP vastet ja võrdleb seda argumendis antud IP-ga
if [ $IP = $(grep $IP '/etc/network/interfaces' | cut -d"s" -f3 | cut -d" " -f2  | sort -u) ]; then
        echo "alias olemas"
        exit 0
else
        echo "aliast pole"
        exit 1
fi

Revision as of 16:05, 11 May 2011