Advertisement
Guest User

Untitled

a guest
May 24th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #!/bin/bash
  2. if [ $# -lt 1 ]
  3. then
  4. echo "USAGE: $0 <block device> $1 <name>"
  5. exit 1
  6. fi
  7.  
  8. tmp=/tmp/SPC-OS_rename-$RANDOM
  9.  
  10. mkdir -p $tmp/root
  11.  
  12. mount $1 $tmp/root
  13.  
  14. echo $2 > $tmp/root/etc/hostname
  15.  
  16. sed -i "/127.0.0.1/c\127.0.0.1 localhost.localdomain localhost $2" $tmp/root/etc/hosts
  17. sed -i "/::1/c\::1 localhost.localdomain localhost $2" $tmp/root/etc/hosts
  18.  
  19. sed -i "/name/c\name=$2-Picam" $tmp/root/home/spc-eyepi/picam.ini
  20. sed -i "/name/c\name=$2" $tmp/root/home/spc-eyepi/eyepi.ini
  21.  
  22. umount $tmp/root
  23. rm -rf $tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement