Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. usage() {
  4.    echo "usage : $0 nouveau_nom_hote"
  5.    exit 1
  6. }
  7.  
  8. [ -z $1 ] && usage
  9.  
  10. ancien=`hostname`
  11. nouveau=$1
  12.  
  13. for file in \
  14.    /etc/exim4/update-exim4.conf.conf \
  15.    /etc/printcap \
  16.    /etc/hostname \
  17.    /etc/hosts \
  18.    /etc/ssh/ssh_host_rsa_key.pub \
  19.    /etc/ssh/ssh_host_dsa_key.pub \
  20.    /etc/motd \
  21.    /etc/ssmtp/ssmtp.conf
  22. do
  23.    [ -f $file ] && sed -i.old -e "s:$ancien:$nouveau:g" $file
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement