1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Add some runtime admin/tool scripts

This commit is contained in:
Poul-Henning Kamp 2005-05-19 15:23:47 +00:00
parent 99998ae585
commit a2830531c0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146402
4 changed files with 84 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# Copyright (c) 2004 Poul-Henning Kamp
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD$
set -ex
passwd root
mount /dev/ad0s3 /mnt
cp /etc/master.passwd /etc/passwd /etc/pwd.db /etc/spwd.db /etc/group /mnt
umount /mnt

View File

@ -0,0 +1,17 @@
#!/bin/sh
#
# Copyright (c) 2004 Poul-Henning Kamp
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD$
set -ex
mount /dev/ad0s3 /mnt
mkdir -p /mnt/ssh
(
cd /etc/ssh
cp ssh_host_* /mnt/ssh
)
umount /mnt

View File

@ -0,0 +1,24 @@
#!/bin/sh
#
# Copyright (c) 2004 Poul-Henning Kamp
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD$
#
# Script to update partition 1 on a NanoBSD system.
#
# usage:
# ssh somewhere cat image.s1 | sh updatep1
#
set -e
if mount | grep ad0s1 > /dev/null ; then
echo "You are running partition 1 already"
echo "you probably want to use 'updatep2' instead"
exit 1
fi
dd of=/dev/ad0s1 obs=64k
boot0cfg -s 1 -v ad0

View File

@ -0,0 +1,28 @@
#!/bin/sh
#
# Copyright (c) 2004 Poul-Henning Kamp
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD$
#
# Script to update partition 2 on a NanoBSD system.
#
# usage:
# ssh somewhere cat image.s1 | sh updatep2
#
set -e
if mount | grep ad0s2 > /dev/null ; then
echo "You are running partition 2 already"
echo "you probably want to use 'updatep1' instead"
exit 1
fi
dd of=/dev/ad0s2 obs=64k
mount /dev/ad0s2a /mnt
sed -i "" 's/ad0s1/ad0s2/' /mnt/conf/base/etc/fstab
sed -i "" 's/ad0s1/ad0s2/' /mnt/etc/fstab
umount /mnt
boot0cfg -s 2 -v ad0