From be4e3b070723cf1bb464f62057d3472747cca804 Mon Sep 17 00:00:00 2001 From: Giulio Date: Thu, 24 Jun 2021 19:48:00 +0200 Subject: [PATCH] Basic testing scripts --- backup.sh | 9 +++++++++ pull.sh | 7 +++++++ restore.sh | 6 ++++++ update.sh | 6 ++++++ 4 files changed, 28 insertions(+) create mode 100755 backup.sh create mode 100755 pull.sh create mode 100755 restore.sh create mode 100755 update.sh diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..8fc1ddf --- /dev/null +++ b/backup.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +mkdir -p /home/user/backup/qubes +mkdir -p /home/user/backup/qubes/vm/mix/ +mkdir -p /home/user/backup/qubesadmin/ + +cp /usr/lib/python3.5/qubes/firewall.py /home/user/backup/qubes/ +cp /usr/lib/python3.5/qubes/vm/mix/net.py /home/user/backup/qubes/vm/mix/ +cp /usr/lib/python3.5/qubesadmin/firewall.py /home/user/backup/qubesadmin/ diff --git a/pull.sh b/pull.sh new file mode 100755 index 0000000..6199fac --- /dev/null +++ b/pull.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +mkdir -p /tmp/core-admin/qubes/ +mkdir -p /tmp/core-admin/qubes/vm/mix/ +mkdir -p /tmp/core-admin-client/qubesadmin/ +scp g@192.168.88.10:/mnt/c/Users/g/Documents/GSOC/sources/core-admin/qubes/firewall.py /tmp/core-admin/qubes/firewall.py +scp g@192.168.88.10:/mnt/c/Users/g/Documents/GSOC/sources/core-admin/qubes/vm/mix/net.py /tmp/core-admin/qubes/vm/mix/net.py +scp g@192.168.88.10:/mnt/c/Users/g/Documents/GSOC/sources/core-admin-client/qubesadmin/firewall.py /tmp/core-admin-client/qubesadmin/firewall.py diff --git a/restore.sh b/restore.sh new file mode 100755 index 0000000..36a6a62 --- /dev/null +++ b/restore.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +cp /home/user/backup/qubes/firewall.py /usr/lib/python3.5/qubes/firewall.py +cp /home/user/backup/qubes/vm/mix/net.py /usr/lib/python3.5/qubes/vm/mix/net.py +cp /home/user/backup/qubesadmin/firewall.py /usr/lib/python3.5/qubesadmin/firewall.py +systemctl restart qubesd diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..1b86a22 --- /dev/null +++ b/update.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +qvm-run --pass-io sys-net 'cat /tmp/core-admin/qubes/firewall.py' > /usr/lib/python3.5/qubes/firewall.py +qvm-run --pass-io sys-net 'cat /tmp/core-admin/qubes/vm/mix/net.py' > /usr/lib/python3.5/qubes/vm/mix/net.py +qvm-run --pass-io sys-net '/tmp/core-admin-client/qubesadmin/firewall.py' > /usr/lib/python3.5/qubesadmin/firewall.py +systemctl restart qubesd