fix: Add requirements for install script
All checks were successful
Build Docker / Build_Docker (push) Successful in 35s

This commit is contained in:
Nathan Woodburn 2024-06-20 16:05:40 +10:00
parent de7dd7fe9a
commit 1fa923751d
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 25 additions and 7 deletions

View File

@ -6,10 +6,17 @@ if [ "$EUID" -ne 0 ]
exit
fi
# Make sure working directory is /root
if [ "$PWD" != "/root" ]
then echo "Please run this script from /root directory."
exit
fi
chmod +x cert.sh cert.py
sudo apt-get install -y dnsdist
# Install certbot
sudo apt install snapd
sudo apt install snapd -y
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --manual --manual-auth-hook ./cert.py --preferred-challenges dns -d hnsdoh.com --deploy-hook ./cert.sh
@ -46,6 +53,7 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
cd /root # Double check this path
# Install Node.js
sudo apt install build-essential -y
nvm install 20.14.0
npm install -g node-gyp

18
test.sh
View File

@ -1,13 +1,23 @@
#!/bin/bash
# Get Node IPs
RESOLVED_IPS=$(dig +short hnsdoh.com)
NODE_IPS=($RESOLVED_IPS)
if [ ${#NODE_IPS[@]} -eq 0 ]; then
# Check if script has ip address as argument
if [ -z "$1" ]; then
# Get Node IPs
RESOLVED_IPS=$(dig +short hnsdoh.com)
NODE_IPS=($RESOLVED_IPS)
if [ ${#NODE_IPS[@]} -eq 0 ]; then
echo "No IP addresses resolved for hnsdoh.com. Exiting."
exit 1
fi
fi
# If script has ip address as argument, use that
if [ -n "$1" ]; then
# Add all arguments to NODE_IPS array
NODE_IPS=("$@")
fi
# Define the domain and host for kdig commands
TLS_HOST="hnsdoh.com"