From a4ed44f1a95f52e3c3aa41db5b9d942165a1cde6 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Mon, 19 Jun 2023 11:48:13 -0700 Subject: [PATCH 1/8] updated to functions v1.6.0 --- PRbL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRbL b/PRbL index 2fac6ba..4c8211b 160000 --- a/PRbL +++ b/PRbL @@ -1 +1 @@ -Subproject commit 2fac6ba3a335a89acc07287928446bd6b92169d1 +Subproject commit 4c8211b4f8ea669f2f4d2e317c55f2663b8f42fc From e72294d0392b5411f93d8279bf7ef9baccec9f57 Mon Sep 17 00:00:00 2001 From: alanw Date: Tue, 20 Jun 2023 12:27:07 -0700 Subject: [PATCH 2/8] refactored repositories install methods --- extras/Slipstream.install | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/extras/Slipstream.install b/extras/Slipstream.install index 811134b..7d2bfb0 100755 --- a/extras/Slipstream.install +++ b/extras/Slipstream.install @@ -1,8 +1,9 @@ #!/bin/bash # CodeDog Bootstrap installer script # To run this script without cloning or downloading anything: -# bash <(curl -ks 'https://github.com/pyr0ball/PRbL-bashrc/raw/main/extras/Slipstream.install') +# curl -H 'Cache-Control: no-cache' -kLs 'https://github.com/pyr0ball/PRbL-bashrc/raw/main/extras/Slipstream.install' | bash -s -- -i # Bash expansions to get the name and location of this script when run +installdir="$HOME/.local/share/s3dk" scriptname="${BASH_SOURCE[0]##*/}" rundir="${BASH_SOURCE[0]%/*}" @@ -28,7 +29,6 @@ else fi logfile="${rundir}/${pretty_date}_${scriptname}.log" -installdir="$HOME/devl" # Dependencies sys_packages=( @@ -43,9 +43,9 @@ pip_packages=( ) repo_packages=( - https://github.com/BruceDLong/CodeDog.git - https://github.com/BruceDLong/Proteus.git - https://github.com/BruceDLong/Slipstream.git + BruceDLong/CodeDog + BruceDLong/Proteus + BruceDLong/Slipstream ) prbl_packages=( @@ -174,12 +174,30 @@ install(){ fi run mkdir -p $installdir pushd $installdir - for repo in ${repo_packages[@]} ; do - clone-repo $repo + for repo in "${repo_packages[@]}"; do + if ! check-git-repository "repositories/${repo#*/}"; then + if [ -d "repositories/${repo#*/}" ] ; then + warn "Existing repo ${repo#*/} is broken..." + return 1 + else + logger echo "Cloning ${repo} into ${installdir}/repositories/${repo#*/}" + clone-repo "https://github.com/$repo" "${installdir}/repositories/${repo#*/}" + fi + else + pushd "repositories/${repo#*/}" + if [[ ${VERSIONS[${repo#*/}]} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Version tag detected: ${VERSIONS[${repo#*/}]}" + git checkout "${VERSIONS[${repo#*/}]}" + else + echo "Commit hash detected: ${VERSIONS[${repo#*/}]}" + git checkout -q "${VERSIONS[${repo#*/}]}" + fi + popd + fi done popd pushd $installdir/Proteus - run sudo python3 ruleMgr.py + run sudo python3 ruleMgr.py && logger echo "Proteus Initialized..." popd pushd $installdir/Slipstream run $installdir/CodeDog/codeDog ./Slipstream.dog && logger echo "Slipstream app built at ${installdir}/Slipstream/LinuxBuild" From dd47b781a170cc32b3e64ebc5ef6cb43d57190a0 Mon Sep 17 00:00:00 2001 From: alanw Date: Tue, 20 Jun 2023 14:15:31 -0700 Subject: [PATCH 3/8] updated to PRbL v1.6.3 --- PRbL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRbL b/PRbL index 4c8211b..a031274 160000 --- a/PRbL +++ b/PRbL @@ -1 +1 @@ -Subproject commit 4c8211b4f8ea669f2f4d2e317c55f2663b8f42fc +Subproject commit a0312747a6aa655fe20ec0b11a91ca519336535f From ff995c1b7eab75fe91aae4658474a3a82b130276 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Tue, 20 Jun 2023 22:52:31 -0700 Subject: [PATCH 4/8] updated to PRbL v1.6.4 --- PRbL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRbL b/PRbL index 4c8211b..b24e2f6 160000 --- a/PRbL +++ b/PRbL @@ -1 +1 @@ -Subproject commit 4c8211b4f8ea669f2f4d2e317c55f2663b8f42fc +Subproject commit b24e2f6b0bbc66e43e1ba957295d37e836b5b43e From e1615ae23d893efe9848322bdc0f72dbdd65c802 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 22 Jun 2023 12:30:11 -0700 Subject: [PATCH 5/8] modified python dependency resolution to use function --- extras/Slipstream.install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/Slipstream.install b/extras/Slipstream.install index 7d2bfb0..6424e10 100755 --- a/extras/Slipstream.install +++ b/extras/Slipstream.install @@ -67,12 +67,12 @@ check-deps(){ done pybin=$(which python3) if [ -z $pybin ] ; then - run install-packages python3 python3-pip + bins_missing+=(python3) # TODO: make a universal package install function fi pipbin=$(which pip3) if [ -z $pipbin ] ; then - run install-packages python3-pip + bins_missing+=(pip3) fi for pkg in ${pip_packages[@]} ; do pippkg_installed=$(pip list | grep -F $pkg ; echo $?) @@ -91,7 +91,7 @@ check-deps(){ local _bins_missing=${#bins_missing[@]} # If higher than 0, return a fail (1) if [[ $_bins_missing != 0 ]] ; then - return 1 + return ${#_bins_missing} else return 0 fi From 63cb56fa199d0a7dbd2b51f652eb3161a2d79b40 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 22 Jun 2023 12:30:35 -0700 Subject: [PATCH 6/8] updated PRbL to v1.7.1 --- PRbL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRbL b/PRbL index b24e2f6..6cddac4 160000 --- a/PRbL +++ b/PRbL @@ -1 +1 @@ -Subproject commit b24e2f6b0bbc66e43e1ba957295d37e836b5b43e +Subproject commit 6cddac497d6977e969c2fc5e8def0b6f19fb590f From 47608555550101f95725181056120c3e06494861 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 22 Jun 2023 13:00:49 -0700 Subject: [PATCH 7/8] fixed post-install script locations --- extras/Slipstream.install | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extras/Slipstream.install b/extras/Slipstream.install index 6424e10..6ed504e 100755 --- a/extras/Slipstream.install +++ b/extras/Slipstream.install @@ -184,23 +184,23 @@ install(){ clone-repo "https://github.com/$repo" "${installdir}/repositories/${repo#*/}" fi else - pushd "repositories/${repo#*/}" + pushd "${installdir}/repositories/${repo#*/}" if [[ ${VERSIONS[${repo#*/}]} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Version tag detected: ${VERSIONS[${repo#*/}]}" git checkout "${VERSIONS[${repo#*/}]}" else - echo "Commit hash detected: ${VERSIONS[${repo#*/}]}" + echo "Branch Name / Commit hash detected: ${VERSIONS[${repo#*/}]}" git checkout -q "${VERSIONS[${repo#*/}]}" fi popd fi done popd - pushd $installdir/Proteus + pushd $installdir/repositories/Proteus run sudo python3 ruleMgr.py && logger echo "Proteus Initialized..." popd - pushd $installdir/Slipstream - run $installdir/CodeDog/codeDog ./Slipstream.dog && logger echo "Slipstream app built at ${installdir}/Slipstream/LinuxBuild" + pushd $installdir/repositories/Slipstream + run $installdir/repositories/CodeDog/codeDog ./Slipstream.dog && logger echo "Slipstream app built at ${installdir}/repositories/Slipstream/LinuxBuild" popd } From 7ffd90baec3a6a9a531e4bcc7c3ff381336c6b31 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 29 Jun 2023 21:10:32 -0700 Subject: [PATCH 8/8] fixed unexpended tabs in quickinfo --- lib/skel/.bashrc.d/11-quickinfo.bashrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/skel/.bashrc.d/11-quickinfo.bashrc b/lib/skel/.bashrc.d/11-quickinfo.bashrc index 3538ac5..65e93f1 100755 --- a/lib/skel/.bashrc.d/11-quickinfo.bashrc +++ b/lib/skel/.bashrc.d/11-quickinfo.bashrc @@ -327,10 +327,10 @@ boxline "" for((i=0; i<"${#adapters[@]}"; i++ )); do if [[ $show_disconnected != true ]] ; then if [[ ${ifups[$i]} == up ]] ; then - boxline " ${adapters[$i]}: ${cyn}${ips[$i]}${dfl}\t| ${blu}${macs[$i]}${dfl}" + boxline " ${adapters[$i]}: ${cyn}${ips[$i]}${dfl | ${blu}${macs[$i]}${dfl}" fi else - boxline " ${adapters[$i]}: ${cyn}${ips[$i]}${dfl}\t| ${blu}${macs[$i]}${dfl}" + boxline " ${adapters[$i]}: ${cyn}${ips[$i]}${dfl} | ${blu}${macs[$i]}${dfl}" fi done boxline " WAN IP: ${ylw}${wan_ip}${dfl}" @@ -345,7 +345,7 @@ boxline " Memory used/total: ${mem_usage}" boxline " ${unl}Disk Info:${dfl}" boxline "${unl}$(printf '\t|%-4s\t%-4s\t%-4s\t%-4s\n' Usage Free Mount Volumes)${dfl}" for((i=0; i<"${#logicals[@]}"; i++ )); do - boxline "\t$(printf '|%-4s\t%-4s\t%-4s\t%-4s\n' ${usages[$i]} ${freespaces[$i]} ${mounts[$i]} ${logicals[$i]})" + boxline " $(printf '|%-4s\t%-4s\t%-4s\t%-4s\n' ${usages[$i]} ${freespaces[$i]} ${mounts[$i]} ${logicals[$i]})" done boxline "" if [[ "$need_updates" == "true" ]] ; then