-
Notifications
You must be signed in to change notification settings - Fork 7
/
postinst.sh
37 lines (30 loc) · 1.16 KB
/
postinst.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
################################################################################
#
# BrowserBox, a VM with Firefox preinstalled and preconfigured
#
# (c) 2020,2021 Tom Stöveken
#
# License: GPLv3 ff
#
# This file is run after preseed.cfg largest part is done and target and
# cdrom are still mounted.
#
################################################################################
#always exit cleanly, the virtualbox additions needed this quirk or otherwise it signaled an issue
function cleanup {
exit 0
}
trap cleanup EXIT
#empty message of the day
echo -n "" > /etc/motd
#enable backports for wireguard in buster
echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/buster-backports.list
apt update
apt install -y wireguard
#extract the tarball to the root directory, all extracted files will be owned by root:root
#directories that already exist will not be overwritten
tar --directory=/ --strip-components=1 --no-same-owner --owner=root --group=root --no-overwrite-dir --preserve-permissions --extract --gzip --file /tmp/files.tgz
#fix permissions and ownership
chown -R bbuser:bbuser /home/bbuser
exit 0