From 8f893d246e0fb1373031cd3a7f1c11b3d0d9d247 Mon Sep 17 00:00:00 2001 From: Paul M Date: Mon, 2 Oct 2023 20:53:01 -0500 Subject: [PATCH] save point --- os_probe.bash | 4 ++-- syssetup.bash | 7 +++++-- test.bash | 12 ++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 test.bash diff --git a/os_probe.bash b/os_probe.bash index 7fe0eef..0abafd3 100755 --- a/os_probe.bash +++ b/os_probe.bash @@ -9,13 +9,13 @@ if [ -x "$(command -v apt-get)" ]; then # set environment variable for os - export osp="Debian" + osp="Debian" fi # check if pacman is installed if [ -x "$(command -v pacman)" ]; then - export osp="Arch" + osp="Arch" fi # I know its so high tech and amazing right? diff --git a/syssetup.bash b/syssetup.bash index cae4160..708faa0 100755 --- a/syssetup.bash +++ b/syssetup.bash @@ -1,5 +1,7 @@ #!/bin/bash +set -x + if [ "$(id -u)" != "0" ]; then echo "You should run this script as root" sleep 3 @@ -7,8 +9,8 @@ if [ "$(id -u)" != "0" ]; then fi # Check the OS, it sets a env variable as a result -./os_probe.bash -./check.bash +source ./os_probe.bash +source ./check.bash # Some menu things @@ -46,6 +48,7 @@ function copy_config() { tmpdir=$(mktemp -d) echo $tmpdir cp -r /etc/ $tmpdir + # if [${osp} = "Debian"]; then dpkg --get-selections > $tmpdir/installed_packages arcdir=$(mktemp -d) echo $arcdir diff --git a/test.bash b/test.bash new file mode 100755 index 0000000..da3d5e6 --- /dev/null +++ b/test.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +source ./os_probe.bash + + +if [ "$osp" = "Debian" ]; then + echo "Debian" +fi + +if [ "$osp" = "Arch" ]; then + echo "Arch" +fi