One Script more

· 0 Comentarios

The computers in my work (around 800 GNU/Linux ofcourse) something doesn't detect the network configuration when te Operative System start, so we need to go to fix that, that's not problem, the problem is betwen 50 and 60 computers everyday lost the configuration and we need to fix it manualy, the problem is when i'm reading or studyng some manual, so here i leave one script to do it automatic, only edited crontab to execute all the day on intervals of one hour.
#!/bin/bash
#================================================
# Author: ll!z0 lliz0.lliz0@gmail.com
# Name: Restart_Net_Configuration.sh
# Date: Sat Jun 16 23:12:37 2007
# Description: Script to restart Network Config
# Use whith crontab
#================================================

#rm /tmp/ping*

a=4 b=0 c=3

ping -c3 127.0.1.1 > /tmp/ping.dat

sizefile=$(ls -s /tmp/ping.dat > /tmp/pingsize.dat  awk '{print$1}' /tmp/pingsize.dat)

if [ "$sizefile" -eq "$b" ]
then
echo "Size of ping.dat: $sizefile restarted net configuration">> /tmp/RND.log
/etc/init.d/network restart
fi

cat /tmp/ping.dat  grep receive > /tmp/package.dat
paqsend=$(cat /tmp/package.dat  awk '{getline; print(substr($4,1,2))}')

if [ "$paqsend" -eq "$b" ]
then
echo `date` " restarted net configuration -$paqsend-" >> /tmp/RND.log
/etc/init.d/network restart
fi

if [ "$paqsend" -eq "$c" ]
then
echo `date` " net configuration is correct -$paqsend-" >> /tmp/RND.log
fi 

Read VS Read

· 0 Comentarios

Sometimes my boss make me a question what is the diference between read and read?, there is not difference, i answered him, the only difference is if you understand what you read... And this stupid text so that? I was looking for how pass a directory whith ssh
# scp file root@host:/root
there is no problem with a file "el pedo" it was pass a directory, i read and read manuals without to find the answer, here this the important "the difference is if you understand what you read..." the problem was solved whit the parameter "-R"
# scp -R directory root@host:/root

About Me

Mi foto
Soy Un Wey Aliviniado, prefiero tener cuates que amigos OGT con los OGT's

Labels