Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Page Tree
expandCollapseAlltrue
rootSuper Nodes

*


Panel
borderColorgrey
bgColorwhite
titleColorblack
borderWidth1
titleBGColorwhite
borderStylesolid
titleLanguages


This page will be updated with the most commonly used scripts to help simplify node maintenance

  • Upgrade Script
  • Tor ScriptBackup Script
  • Restore Script




DescriptionCommand

Upgrade Script
1

Download and install latest system and security updates

Update the packages

Remove old files

The following block of text is meant to be copied and pasted in its entirety

Code Block
cat <<EOF > ~/upgrade
_script
.sh
#!/bin/bash
sudo apt-get 
-y
update
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
sudo apt-get clean
sudo apt-get autoclean
EOF


Code Block
chmod u+x ~/upgrade
_script
.sh


Code Block
sudo ~/upgrade
_script
.sh



Tor Script - ONLY USE IF USING TOR
2

Update the torrc file to make tor work with the

zen

zend daemon

  • Some tor repo updates make changes to the torrc file, this script is intended to repair the tor service for zend
  • You will need to restart the zend client after running the script for changes to take affect, see System Maintenance for commands

The following block of text is meant to be copied and pasted in its entirety

Code Block
cat <<EOF > ~/tor
_script
.sh
#!/bin/bash
sudo sed -i 's/#ControlPort 9051/ControlPort 9051/g' /etc/tor/torrc
sudo sed -i 's/#CookieAuthentication 1/CookieAuthentication 1/g' /etc/tor/torrc
sudo su -c "echo 'CookieAuthFileGroupReadable 1' >> /etc/tor/torrc"
sudo su -c "echo 'LongLivedPorts 9033' >> /etc/tor/torrc"
sudo systemctl restart tor.service
EOF


Code Block
chmod u+x ~/tor
_script
.sh


Code Block
sudo
~/tor_script.shBackup Script3

Replace <FQDN> with your fully-qualified domain name, remove '#' from '#7z a tor.7z ~/.zen/onion_private_key' if using tor

More detail can be found here: Secure Node Backup

Code Block
FQDN=<FQDN>

The following block of text is meant to be copied and pasted in its entirety

Code Block
cat <<EOF > ~/backup_script.sh
#!/bin/bash
#Create a temp Directory
mkdir ~/.temp
cd ~/.temp
#Archive Zend Files
7z a zen.conf.7z ~/.zen/zen.conf
7z a wallet.7z ~/.zen/wallet.dat
#7z a tor.7z ~/.zen/onion_private_key
#Archive Secure Node Tracker Config Files
7z a secnodetracker.7z ~/zencash/secnodetracker/config
#Archive Script Files
7z a scripts.7z ~/*.sh -xr!acme.sh
#Create Encrypted Archive of Backup Files
cd
7z a -p backup.$FQDN.7z ~/.temp
#Erase Temporary Files
rm -rf ~/.temp
cd
EOF
Code Block
chmod u+x ~/backup_script.sh
Code Block
~/backup_script.sh
Restore Script4

Replace <FQDN> with your fully qualified domain name, remove '#' from '#7z x tor.7z -ozen' and '#cp /home/$USER/.temp/zen/onion_private_key /home/$USER/.zen/' if using tor

More detail can be found here: Secure Node Restore

Code Block
FQDN=<FQDN>

The following block of text is meant to be copied and pasted in its entirety

Code Blockcat <<EOF
 
>
~/
restore_script.sh #!/bin/bash #Create a temp Directory mkdir ~/.temp cd ~/.temp #Extract Encrypted Archive of Backup Files 7z x backup.$FQDN.7z #Extract Zend Files 7z x zen.conf.7z -ozen 7z x wallet.7z -ozen #7z x
tor
.7z -ozen #Extract Secure Node Tracker Config 7z x secnodetracker.7z -osecnodetracker #Extract Script Files 7z x scripts
.
7z -oscripts #Erase .7z Files rm *.7z #Make needed directories mkdir /home/$USER/zencash/secnodetracker/config/ #Copy needed files cp /home/$USER/.temp/secnodetracker/config/* /home/$USER/zencash/secnodetracker/config/ #cp /home/$USER/.temp/zen/onion_private_key /home/$USER/.zen/ cp /home/$USER/.temp/zen/wallet.dat /home/$USER/.zen/ cp /home/$USER/.temp/zen/zen.conf /home/$USER/.zen/ cp /home/$USER/.temp/scripts/*.
sh
/home/$USER/ #Erase Temporary Files rm -rf ~/.temp cd EOF
Code Block
chmod u+x ~/restore_script.sh
code
~/restore_script.sh



Insert excerpt
ZEN:Social LinksZEN:
Social Links
nopaneltrue