jeudi 1 janvier 2015

How i make this script execute every minute without cron?


I have this:



#!/bin/bash

wlan=`/sbin/ifconfig wlan0 | grep inet\ addr | wc -l`
if [ $wlan -eq 0 ]; then
echo wlan0 not connected, connecting...
echo
sudo ifup wlan0
logger wlan0 reconnected.
echo
echo wlan0 reconnected.
else
echo
echo wlan0 connected. Nothing to do.
fi


Maybe with sleep command i can make this wait a minute, but i've been reading that there is no "goto" command in shell scripting so i don't know how to jump from the end to the start of scripts so it can repeat the steps forever..



Aucun commentaire:

Enregistrer un commentaire