Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -lt 1 ]
- then
- echo "USAGE: $0 <block device> $1 <name>"
- exit 1
- fi
- tmp=/tmp/SPC-OS_rename-$RANDOM
- mkdir -p $tmp/root
- mount $1 $tmp/root
- echo $2 > $tmp/root/etc/hostname
- sed -i "/127.0.0.1/c\127.0.0.1 localhost.localdomain localhost $2" $tmp/root/etc/hosts
- sed -i "/::1/c\::1 localhost.localdomain localhost $2" $tmp/root/etc/hosts
- sed -i "/name/c\name=$2-Picam" $tmp/root/home/spc-eyepi/picam.ini
- sed -i "/name/c\name=$2" $tmp/root/home/spc-eyepi/eyepi.ini
- umount $tmp/root
- rm -rf $tmp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement