cleanup created ssh keys upon finish
This commit is contained in:
parent
3017288424
commit
9ea7593400
|
|
@ -38,7 +38,6 @@ mirror="http://packages.devuan.org/merged"
|
||||||
# mirror repo section
|
# mirror repo section
|
||||||
section="main"
|
section="main"
|
||||||
|
|
||||||
|
|
||||||
# core packages for the system
|
# core packages for the system
|
||||||
core_packages=(devuan-keyring debian-keyring)
|
core_packages=(devuan-keyring debian-keyring)
|
||||||
core_packages+=(git-core binutils ca-certificates curl)
|
core_packages+=(git-core binutils ca-certificates curl)
|
||||||
|
|
@ -54,7 +53,6 @@ system_packages=(sysvinit ssh)
|
||||||
workdir="$H/workdir"
|
workdir="$H/workdir"
|
||||||
strapdir="${workdir}/strapdir"
|
strapdir="${workdir}/strapdir"
|
||||||
|
|
||||||
|
|
||||||
# declare zuper globals
|
# declare zuper globals
|
||||||
vars+=(os release version mirror section)
|
vars+=(os release version mirror section)
|
||||||
vars+=(workdir strapdir)
|
vars+=(workdir strapdir)
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ bootstrap() {
|
||||||
mountdevproc ${strapdir}
|
mountdevproc ${strapdir}
|
||||||
|
|
||||||
escalate "root" "chroot ${strapdir} /thirdstage.sh"
|
escalate "root" "chroot ${strapdir} /thirdstage.sh"
|
||||||
|
escalate "root" "chroot ${strapdir} /cleanup.sh"
|
||||||
|
|
||||||
umountdevproc ${strapdir}
|
umountdevproc ${strapdir}
|
||||||
|
|
||||||
|
|
@ -84,6 +85,8 @@ config_cleanup() {
|
||||||
|
|
||||||
rm -f /debconf.set
|
rm -f /debconf.set
|
||||||
rm -f /thirdstage.sh
|
rm -f /thirdstage.sh
|
||||||
|
rm -f /etc/ssh/*key
|
||||||
|
rm -f /etc/ssh/*.pub
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,7 +145,6 @@ tar_bootstrap() {
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
ls -lh $bootstrap_tgz
|
ls -lh $bootstrap_tgz
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tar_unpack() {
|
tar_unpack() {
|
||||||
|
|
|
||||||
|
|
@ -39,22 +39,22 @@ escalate() {
|
||||||
|
|
||||||
mountdevproc() {
|
mountdevproc() {
|
||||||
fn mountdevproc $@
|
fn mountdevproc $@
|
||||||
strapdir="$1"
|
local mntdir="$1"
|
||||||
req=(strapdir)
|
req=(mntdir)
|
||||||
ckreq || return 1
|
ckreq || return 1
|
||||||
|
|
||||||
escalate "root" "mount -t proc proc ${strapdir}/proc" && act "mounted /proc"
|
escalate "root" "mount -t proc proc ${mntdir}/proc" && act "mounted /proc"
|
||||||
escalate "root" "mount -o bind /dev ${strapdir}/dev" && act "mounted /dev"
|
escalate "root" "mount -o bind /dev ${mntdir}/dev" && act "mounted /dev"
|
||||||
escalate "root" "mount -o bind /dev/pts ${strapdir}/dev/pts" && act "mounted /dev/pts"
|
escalate "root" "mount -o bind /dev/pts ${mntdir}/dev/pts" && act "mounted /dev/pts"
|
||||||
}
|
}
|
||||||
|
|
||||||
umountdevproc() {
|
umountdevproc() {
|
||||||
fn umountdevproc $@
|
fn umountdevproc $@
|
||||||
strapdir="$1"
|
local mntdir="$1"
|
||||||
req=(strapdir)
|
req=(mntdir)
|
||||||
ckreq || return 1
|
ckreq || return 1
|
||||||
|
|
||||||
escalate "root" "umount ${strapdir}/dev/pts" && act "unmounted /dev/pts" && sleep 2
|
escalate "root" "umount ${mntdir}/dev/pts" && act "unmounted /dev/pts" && sleep 2
|
||||||
escalate "root" "umount ${strapdir}/dev" && act "unmounted /dev" && sleep 2
|
escalate "root" "umount ${mntdir}/dev" && act "unmounted /dev" && sleep 2
|
||||||
escalate "root" "umount ${strapdir}/proc" && act "unmounted /proc" && sleep 2
|
escalate "root" "umount ${mntdir}/proc" && act "unmounted /proc" && sleep 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue