Created
April 14, 2015 07:45
-
-
Save gdunstone/bf5fad5ab0b28c9c6c4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment