qubes-linux-template-builder/scripts_debian/wheezy+whonix/04_install_qubes_post.sh

60 lines
2.0 KiB
Bash
Raw Normal View History

#!/bin/bash
# vim: set ts=4 sw=4 sts=4 et :
#
# Whonix Post Install Steps (after qubes install)
#
# ------------------------------------------------------------------------------
# Source external scripts
# ------------------------------------------------------------------------------
2014-10-28 08:09:55 +00:00
. ${SCRIPTSDIR}/vars.sh
# ------------------------------------------------------------------------------
# Configurations
# ------------------------------------------------------------------------------
2014-10-28 08:09:55 +00:00
if [ "${VERBOSE}" -ge 2 -o "${DEBUG}" == "1" ]; then
set -x
else
set -e
fi
2014-11-07 05:34:38 +00:00
# ------------------------------------------------------------------------------
# Enable Qubes-Whonix services
# ------------------------------------------------------------------------------
2014-11-09 17:53:07 +00:00
chroot "${INSTALLDIR}" systemctl disable qubes-whonix-network.service || :
2014-11-07 05:34:38 +00:00
chroot "${INSTALLDIR}" systemctl enable qubes-whonix-network.service || :
2014-11-09 17:53:07 +00:00
chroot "${INSTALLDIR}" systemctl disable qubes-whonix-firewall.service || :
chroot "${INSTALLDIR}" systemctl enable qubes-whonix-firewall.service || :
chroot "${INSTALLDIR}" systemctl enable qubes-whonix-init.service || :
2014-11-07 05:34:38 +00:00
# ------------------------------------------------------------------------------
# Restore Whonix apt-get
# ------------------------------------------------------------------------------
2014-10-28 08:09:55 +00:00
pushd "${INSTALLDIR}/usr/bin"
{
rm -f apt-get;
cp -p apt-get.anondist apt-get;
}
popd
# ------------------------------------------------------------------------------
# Restore whonix resolv.conf
# ------------------------------------------------------------------------------
2014-10-28 08:09:55 +00:00
pushd "${INSTALLDIR}/etc"
2014-10-26 18:46:20 +00:00
{
2014-10-28 08:09:55 +00:00
rm -f resolv.conf;
cp -p resolv.conf.anondist resolv.conf;
2014-10-26 18:46:20 +00:00
}
popd
# ------------------------------------------------------------------------------
# Cleanup Whonix Installation
# ------------------------------------------------------------------------------
2014-10-28 08:09:55 +00:00
rm -rf "${INSTALLDIR}"/home/user/Whonix
rm -rf "${INSTALLDIR}"/home/user/whonix_binary
rm -f "${INSTALLDIR}"/home/user/whonix_fix
rm -f "${INSTALLDIR}"/home/user/whonix_build.sh