Skip to content

Commit

Permalink
save version number in temp files
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowman committed Aug 27, 2012
1 parent 0fecd68 commit 33148a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions etc/rc.conf.local
Expand Up @@ -19,10 +19,11 @@ for i in $tardirs; do
fi
done

version=`cat /etc/.flashrd_version`

# Untar one-time files, only once per vnd instance
if [ -f /etc/.flashrd_onetime -a -f /etc/.flashrd.version ]; then
onetime=`cat /etc/.flashrd_onetime`
version=`cat /etc/.flashrd_version`
if [ "$onetime" -lt "$version" ]; then
# very unlikely
echo flashrd: onetime $onetime, version $version
Expand All @@ -32,14 +33,14 @@ fi

if [ ! -f /etc/.flashrd_onetime -a -f /flash/onetime.tgz ]; then
tar xpzf /flash/onetime.tgz -C /
touch /etc/.flashrd_onetime
echo $version > /etc/.flashrd_onetime
echo flashrd: onetime extracted
fi

# Untar on-boot files every time
if [ ! -f /tmp/.flashrd_onboot -a -f /flash/onboot.tgz ]; then
tar xpzf /flash/onboot.tgz -C /
touch /tmp/.flashrd_onboot
echo $version > /tmp/.flashrd_onboot
echo flashrd: onboot extracted
fi

Expand Down
6 changes: 4 additions & 2 deletions growimg
Expand Up @@ -33,8 +33,10 @@

unset alt

if [ `uname -s` != "OpenBSD" ]; then
echo Sorry, cowboy. This script only runs on OpenBSD.
uname=`uname -s`

if [ "$uname" != "OpenBSD" -a "$uname" != "Bitrig" ]; then
echo Sorry, cowboy. This script only runs on OpenBSD and similar systems.
exit 1
fi

Expand Down

0 comments on commit 33148a4

Please sign in to comment.