From a5aa69270810c842a350b5d8f14414587aa6b53d Mon Sep 17 00:00:00 2001 From: naturallaw77 Date: Fri, 9 Jun 2023 15:16:26 -0700 Subject: [PATCH] updated reseter source script and icon --- .../Master_Passwords_Reset.sh | 141 +++++++++++------- .../Icon}/Sovran_SystemsOS_Reseter_Icon.svg | 91 ++++------- .../Sovran_SystemsOS_Updater.desktop | 7 + .../localscript_to_remote_updater.sh | 5 + 4 files changed, 128 insertions(+), 116 deletions(-) rename Sovran_SystemsOS_Reseter/{Reseter Source Files => To Install on local Sovran Pro/Icon}/Sovran_SystemsOS_Reseter_Icon.svg (67%) create mode 100644 Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Sovran_SystemsOS_Updater.desktop create mode 100644 Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/localscript_to_remote_updater.sh diff --git a/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh b/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh index 9c6483b..37bd501 100644 --- a/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh +++ b/Sovran_SystemsOS_Reseter/Reseter Source Files/Master_Passwords_Reset.sh @@ -23,72 +23,70 @@ else #### Initial Reseter Tag -ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'mkdir /var/lib/reseter ; touch /var/lib/reseter/started' +ssh -i /home/free/.ssh/factory_login root@${ID} 'mkdir /var/lib/reseter ; touch /var/lib/reseter/started' -if [[ $? != 0 ]]; then - -zenity --error \ - --ellipsize \ - --no-wrap \ - --title="Sovran_SystemsOS_Reseter" \ - --text="Could Not Create New Directory for Reseter Tag" - - exit 1 -fi - - -rm -rf /home/free/.ssh/sovranpro_login - -if [[ $? != 0 ]]; then - -zenity --error \ - --ellipsize \ - --no-wrap \ - --title="Sovran_SystemsOS_Reseter" \ - --text="Could Not Delete Old Sovran Private Keys" - - exit 1 -fi - - - -rm -rf /home/free/.ssh/sovranpro_login.pub - -if [[ $? != 0 ]]; then - -zenity --error \ - --ellipsize \ - --no-wrap \ - --title="Sovran_SystemsOS_Reseter" \ - --text="Could Not Delete Old Sovran Pro Public Keys" - - exit 1 -fi - - - -PASSWDNEW=$(zenity --password --title="Please Type In A New Sovran Pro Updater Password") - -ssh-keygen -q -N "$PASSWDNEW" -t ed25519 -f /home/free/.ssh/sovranpro_login - -if [[ $? -eq 1 ]]; then - - exit 2 - - elif [[ $? != 0 ]]; then + if [[ $? != 0 ]]; then zenity --error \ - --ellipsize \ - --no-wrap \ - --title="Sovran_SystemsOS_Reseter" \ - --text="Could Not Reset Sovran Pro Login Passwords" + --ellipsize \ + --no-wrap \ + --title="Sovran_SystemsOS_Reseter" \ + --text="Could Not Start, Already Completed" exit 1 + fi + + +PASS=$(zenity --password --title="Please Type In A New Sovran Pro Updater Password") + + if [[ $? -eq 1 ]]; then + exit 1 + else - ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'sed -i -e "0,/ssh-ed25519.*/{ s::$(cat /home/free/.ssh/sovranpro_login.pub): }" /root/.ssh/authorized_keys' +ssh-keygen -q -N "${PASS}" -t ed25519 -f /home/free/.ssh/sovranpro_login + + if [[ $? != 0 ]]; then + + zenity --error \ + --ellipsize \ + --no-wrap \ + --title="Sovran_SystemsOS_Reseter" \ + --text="Could Not Create New Login Key" + + exit 1 + fi + + +ssh -i /home/free/.ssh/factory_login root@${ID} 'sed -i -e "0,/ssh-ed25519.*/{ s::$(cat /home/free/.ssh/sovranpro_login.pub): }" /root/.ssh/authorized_keys' + + if [[ $? != 0 ]]; then + + zenity --error \ + --ellipsize \ + --no-wrap \ + --title="Sovran_SystemsOS_Reseter" \ + --text="Could Not Move Key to Root" + + exit 1 + fi + fi + + + rm -rf /home/free/.ssh/factory_login /home/free/.ssh/factory_login.pub + + if [[ $? != 0 ]]; then + + zenity --error \ + --ellipsize \ + --no-wrap \ + --title="Sovran_SystemsOS_Reseter" \ + --text="Could Not Factory Keys" + + exit 1 + fi fi @@ -434,6 +432,35 @@ zenity --error \ fi + +#### RESET LND AND RTL #### + +ssh -i /home/free/.ssh/sovranpro_login root@${ID} << 'EOF' + +systemctl stop bitcoind lnd lightning-loop lightning-pool rtl + +rm -rf /var/lib/lightning-loop /var/lib/lightning-pool /var/lib/lnd + +echo -n $(pwgen -s 33 -1) > /etc/nix-bitcoin-secrets/rtl-password + +nixos-rebuild switch --impure + + +EOF + +if [[ $? != 0 ]]; then + +zenity --error \ + --ellipsize \ + --no-wrap \ + --title="Sovran_SystemsOS_Reseter" \ + --text="Could Not Reset LND or RTL Passwords" + + exit 1 +fi + + + #### FINAL RESETER TAG #### ssh -i /home/free/.ssh/sovranpro_login root@${ID} 'touch /var/lib/reseter/completed' diff --git a/Sovran_SystemsOS_Reseter/Reseter Source Files/Sovran_SystemsOS_Reseter_Icon.svg b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Icon/Sovran_SystemsOS_Reseter_Icon.svg similarity index 67% rename from Sovran_SystemsOS_Reseter/Reseter Source Files/Sovran_SystemsOS_Reseter_Icon.svg rename to Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Icon/Sovran_SystemsOS_Reseter_Icon.svg index c573de6..c46a11f 100644 --- a/Sovran_SystemsOS_Reseter/Reseter Source Files/Sovran_SystemsOS_Reseter_Icon.svg +++ b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Icon/Sovran_SystemsOS_Reseter_Icon.svg @@ -23,55 +23,23 @@ inkscape:deskcolor="#505050" showgrid="false" inkscape:zoom="5.2149125" - inkscape:cx="38.73507" - inkscape:cy="92.810761" + inkscape:cx="17.162321" + inkscape:cy="64.622369" inkscape:window-width="2560" inkscape:window-height="1512" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" - inkscape:current-layer="svg96" /> + transform="matrix(0.1816,0,0,0.1816,35.224187,79.037164)"> diff --git a/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Sovran_SystemsOS_Updater.desktop b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Sovran_SystemsOS_Updater.desktop new file mode 100644 index 0000000..0843de1 --- /dev/null +++ b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/Sovran_SystemsOS_Updater.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Version=1.0 +Terminal=false +Type=Application +Name=Sovran_SystemsOS Updater +Exec=/home/free/.Sovran_Systems/localscript_to_remote_updater.sh +Icon=/home/free/.Sovran_Systems/Icon/Sovran_SystemsOS_Updater_Iconv3.svg \ No newline at end of file diff --git a/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/localscript_to_remote_updater.sh b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/localscript_to_remote_updater.sh new file mode 100644 index 0000000..956f317 --- /dev/null +++ b/Sovran_SystemsOS_Reseter/To Install on local Sovran Pro/localscript_to_remote_updater.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +bash -c "$(curl https://git.sovransystems.com/Sovran_Systems/Software/raw/branch/main/Sovran_SystemsOS_Updater/Updater%20Source%20Files/Update_Sovran_SystemsOS.sh)" + +exit \ No newline at end of file