![]() |
|
|
google unix.com
|
|||||||
| Forum | Registrati | Regole Forum | Collegamenti | Album | FAQ | Members List | Calendario | Ricerca | Today's Posts | Mark Forums Read |
| Shell scripting e di programmazione Pubblica domande su KSH, CSH, SH, Bash, Perl, PHP, sed, awk e da altri script di shell e linguaggi di scripting shell qui. |
Più di UNIX e Linux Forum Argomenti potreste trovare utili
|
||||
| Filo | Thread Starter | Forum | Risposte | Ultimo Post |
| resolv.conf & Internet | stevie_velvet | SUN Solaris | 1 | 08-15-2008 05:26 PM |
| Suse 10 resolv.conf | kjbaumann | SuSE | 2 | 07-15-2008 01:45 PM |
| DNS e resolv.conf | b03der | UNIX for Dummies Domande & Risposte | 10 | 07-26-2002 05:34 AM |
| /etc / resolv.conf | rpnhavoc | Reti IP | 1 | 02-11-2002 01:04 PM |
| E-mail e dati di accesso remoto e resolv.conf | DGM | Reti IP | 2 | 11-21-2001 11:41 AM |
![]() |
|
|
LinkBack | Thread Tools | Cerca in questo Thread | Rate Thread | Modalità di visualizzazione |
|
|
|
||||
|
resolv.conf
HI TUTTI
Sto facendo uno script, che si fa la seguente, sono in cerca di idee 1.Script commenta tutte le voci esistenti nel resolve.conf 2.Add nuove voci di questo tipo abc.example.com 192.168.1.x Sono in grado di utilizzare sed per aggiungere un commento. |
|
||||
|
NO dchp non è in esecuzione il server che è la mia, sono molti i server in modo Ho bisogno di fare uno script che si spostano e controllare ogni reslove.conf e mettere specfic dns enties in ogni server reslove.conf.the valore ti ha dato sono i fectious.
|
|
||||
|
Hi again
Ho fatto lo script, nella sua fase iniziale, hanno bisogno di chiedere una domanda che mi copia di backup dei reslov.conf con questo nome reslov.conf ~ ma un problema è che quando la prossima volta eseguito lo script sarà più scrivere il file di backup con la nuova value.see il mio codice avrete quello che im dicendo, prega ans ASAP questo, la sua urgent.THX A TUTTI Codice:
#!/bin/bash sudo sed -i~ 's?^?#?' /home/syed/shellscript/resolv.conf echo search.example.com >> resolv.conf echo nameserver xxx.xxx.x.x >> resolv.conf echo nameserver xxx.xxx.x.x >> resolv.conf cat /home/syed/shellscript/resolv.conf |
|
|||||
|
Penso che si sta andando su di esso la strada sbagliata.
Codice:
RESOLV=/home/syed/shellscript/resolv.conf exec <$RESOLV >$RESOLV.new while read line ; do echo "# $line" done echo search.example.com echo nameserver xxx.xxx.xxxx.xxxx echo nameserver yyy.yyy.yyyy.yyyy exec >- mv $RESOLV $RESOLV.$$.bak mv $RESOLV.new $RESOLV Ultimo a cura di otheus; al 10/14/2008 03:19 AM.. Motivo: corretto errore per learnbash |
|
||||
|
Non di lavoro vedi sotto
Codice:
#! /bin/bash RESOLV=/tmp/reslov.conf exec < $RESOLV >$RESOLV.new while read line ; do echo "# $line" done echo search.example.com echo nameserver xxx.xxx.xxxx.xxxx echo nameserver yyy.yyy.yyyy.yyyy exec >- mv $RESOLV $RESOLV.$$.bak mv $RESOLV.new $RESOLV tmp] $ ./resolv.sh2 ./resolv.sh2: Linea 3: / tmp / reslov.conf: Nessun file o directory ^ C |
![]() |
| Segnalibri |
| Thread Tools | Cerca in questo Thread |
| Modalità di visualizzazione | Vota questo thread |
|
|