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:
parent
99998ae585
commit
a2830531c0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146402
15
tools/tools/nanobsd/Files/root/change_password
Normal file
15
tools/tools/nanobsd/Files/root/change_password
Normal 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
|
17
tools/tools/nanobsd/Files/root/save_sshkeys
Normal file
17
tools/tools/nanobsd/Files/root/save_sshkeys
Normal 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
|
24
tools/tools/nanobsd/Files/root/updatep1
Normal file
24
tools/tools/nanobsd/Files/root/updatep1
Normal 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
|
28
tools/tools/nanobsd/Files/root/updatep2
Normal file
28
tools/tools/nanobsd/Files/root/updatep2
Normal 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
|
Loading…
Reference in New Issue
Block a user