I want to put an interface down and up every 1 second for 80 times, how can I implement this by a bash script?
Something like this?
COUNT = 80
for n in $(seq -w 1 $COUNT); do
case $n in
[1,3,5,7,9....79]*) # I don't know how to represent the odd value only
ifconfig veth1 down
sleep 1
;;
[2,4,6,8,10....80]*)
ifconfig veth1 up
sleep 1
;;
esac
done