Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- usage() {
- echo "usage : $0 nouveau_nom_hote"
- exit 1
- }
- [ -z $1 ] && usage
- ancien=`hostname`
- nouveau=$1
- for file in \
- /etc/exim4/update-exim4.conf.conf \
- /etc/printcap \
- /etc/hostname \
- /etc/hosts \
- /etc/ssh/ssh_host_rsa_key.pub \
- /etc/ssh/ssh_host_dsa_key.pub \
- /etc/motd \
- /etc/ssmtp/ssmtp.conf
- do
- [ -f $file ] && sed -i.old -e "s:$ancien:$nouveau:g" $file
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement