From 8ec7897ec7b59f6850ab3ec8e6c24fd42dc9dbf9 Mon Sep 17 00:00:00 2001
From: keith <keith@smallshellscript.com>
Date: Thu, 23 Feb 2023 13:36:33 -0800
Subject: [PATCH 1/5] WIP update virtualbox installation

---
 install_virtualbox | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/install_virtualbox b/install_virtualbox
index 5f3943c..5b5b442 100755
--- a/install_virtualbox
+++ b/install_virtualbox
@@ -4,8 +4,8 @@ source ./script_lib/std.inc
 source ./script_lib/install.inc
 source ./script_lib/link.inc
 
-version="6.1.36"
-versionb="152435"
+version="7.0.6"
+versionb="155176"
 filename="virtualbox-${version%.*}_${version}-${versionb}~Debian~bullseye_amd64.deb"
 remote="https://download.virtualbox.org/virtualbox/${version}/${filename}"
 

From 77e5c1a4f57d2e72b073c268794d3e5441a8f270 Mon Sep 17 00:00:00 2001
From: keith <keith@smallshellscript.com>
Date: Thu, 23 Feb 2023 13:51:53 -0800
Subject: [PATCH 2/5] WIP testing vb

---
 install_virtualbox  | 2 +-
 script_lib/link.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/install_virtualbox b/install_virtualbox
index 5b5b442..695f0f0 100755
--- a/install_virtualbox
+++ b/install_virtualbox
@@ -9,7 +9,7 @@ versionb="155176"
 filename="virtualbox-${version%.*}_${version}-${versionb}~Debian~bullseye_amd64.deb"
 remote="https://download.virtualbox.org/virtualbox/${version}/${filename}"
 
-sudo apt-get install -y libqt5core5a libqt5gui5 libqt5opengl5 libqt5printsupport5 libqt5widgets5 libqt5x11extras5 libsdl1.2debian linux-headers-$(uname -r)
+sudo apt-get install -y libxcursor1 libvpx6 libqt5xml5 libqt5x11extras5 libqt5widgets5 libqt5printsupport5 libqt5opengl5 libqt5help5 libqt5gui5 libqt5dbus5 libqt5core5a libgl1 libvulkan1 linux-headers-$(uname -r)
 
 dirname=$(rootname "${filename}")
 
diff --git a/script_lib/link.inc b/script_lib/link.inc
index f352e3b..0b6e9d3 100644
--- a/script_lib/link.inc
+++ b/script_lib/link.inc
@@ -14,7 +14,7 @@ function link_dotfiles() {
 function link_bash_completion() {
   local filename="$1"
   [ ! -d "$HOME/.bash_completion.d" ] && mkdir "$HOME/.bash_completion.d"
-  ln -s -f "$PWD/dotfiles/.bash_completion.d/${filename}" "$HOME/.bash_completion.d/"
+  [ ! -f "$HOME/.bash_completion.d/${filename}" ]  && ln -s -f "$PWD/dotfiles/.bash_completion.d/${filename}" "$HOME/.bash_completion.d/"
   bashrc_source_script "link_bash_completion_${filename}" "$HOME/.bash_completion.d/${filename}"
 }
 

From 69d2410e88ee864cea3fb4a1e5eb2e43eb68fb79 Mon Sep 17 00:00:00 2001
From: Keith Batten <kbatten@gmail.com>
Date: Thu, 23 Feb 2023 23:00:39 +0000
Subject: [PATCH 3/5] WIP starting work on opnsense

---
 install_opnsense | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100755 install_opnsense

diff --git a/install_opnsense b/install_opnsense
new file mode 100755
index 0000000..237327c
--- /dev/null
+++ b/install_opnsense
@@ -0,0 +1,39 @@
+#!/bin/bash -e
+
+./install_virtualbox
+
+download https://download.virtualbox.org/virtualbox/7.0.6/virtualbox-7.0_7.0.6-155176~Debian~bullseye_amd64.deb
+
+exit
+
+source ./script_lib/std.inc
+source ./script_lib/install.inc
+source ./script_lib/link.inc
+
+version="7.0.6"
+versionb="155176"
+filename="virtualbox-${version%.*}_${version}-${versionb}~Debian~bullseye_amd64.deb"
+remote="https://download.virtualbox.org/virtualbox/${version}/${filename}"
+
+sudo apt-get install -y libxcursor1 libvpx6 libqt5xml5 libqt5x11extras5 libqt5widgets5 libqt5printsupport5 libqt5opengl5 libqt5help5 libqt5gui5 libqt5dbus5 libqt5core5a libgl1 libvulkan1 linux-headers-$(uname -r)
+
+#sudo apt-get install -y libqt5core5a libqt5gui5 libqt5opengl5 libqt5printsupport5 libqt5widgets5 libqt5x11extras5 libsdl1.2debian linux-headers-$(uname -r)
+
+dirname=$(rootname "${filename}")
+
+download "${remote}"
+install_deb "${filename}"
+
+link_bin vmadd
+link_bin vmfixnetwork
+link_bin vmimport
+link_bin vmlist
+link_bin vmsnap
+link_bin vmsnapdelete
+link_bin vmsnaplist
+link_bin vmsnaprestore
+link_bin vmstart
+link_bin vmstop
+link_bin vmtag
+
+link_bash_completion vm

From 2964f540783ccb6bd83366f99354cda736f703cd Mon Sep 17 00:00:00 2001
From: Keith Batten <kbatten@gmail.com>
Date: Thu, 23 Feb 2023 23:05:47 +0000
Subject: [PATCH 4/5] WIP

---
 install_opnsense | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/install_opnsense b/install_opnsense
index 237327c..e2ffaae 100755
--- a/install_opnsense
+++ b/install_opnsense
@@ -1,8 +1,16 @@
 #!/bin/bash -e
 
+source ./script_lib/std.inc
+source ./script_lib/install.inc
+
 ./install_virtualbox
 
-download https://download.virtualbox.org/virtualbox/7.0.6/virtualbox-7.0_7.0.6-155176~Debian~bullseye_amd64.deb
+
+version="23.1"
+filename="OPNsense-${version}-OpenSSL-dvd-amd64.iso.bz2"
+remote="https://mirror.sfo12.us.leaseweb.net/opnsense/releases/${version}/${filename}"
+
+download "${remote}"
 
 exit
 

From 55d01a4f95932ab0e1799e503af5bde75107dd10 Mon Sep 17 00:00:00 2001
From: Keith Batten <kbatten@gmail.com>
Date: Thu, 23 Feb 2023 23:15:09 +0000
Subject: [PATCH 5/5] WIP

---
 install_opnsense | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/install_opnsense b/install_opnsense
index e2ffaae..c536ed2 100755
--- a/install_opnsense
+++ b/install_opnsense
@@ -9,9 +9,13 @@ source ./script_lib/install.inc
 version="23.1"
 filename="OPNsense-${version}-OpenSSL-dvd-amd64.iso.bz2"
 remote="https://mirror.sfo12.us.leaseweb.net/opnsense/releases/${version}/${filename}"
+vmdir="~/.vms"
 
 download "${remote}"
 
+mkdir -p "${vmdir}" || true
+vboxmanage createvm --name opnsense --ostype FreeBSD_64 --register --basefolder "${vmdir}"
+
 exit
 
 source ./script_lib/std.inc
