fix: Add requirements for install script
All checks were successful
Build Docker / Build_Docker (push) Successful in 35s
All checks were successful
Build Docker / Build_Docker (push) Successful in 35s
This commit is contained in:
parent
de7dd7fe9a
commit
1fa923751d
10
install.sh
10
install.sh
@ -6,10 +6,17 @@ if [ "$EUID" -ne 0 ]
|
|||||||
exit
|
exit
|
||||||
fi
|
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
|
chmod +x cert.sh cert.py
|
||||||
sudo apt-get install -y dnsdist
|
sudo apt-get install -y dnsdist
|
||||||
# Install certbot
|
# Install certbot
|
||||||
sudo apt install snapd
|
sudo apt install snapd -y
|
||||||
sudo snap install --classic certbot
|
sudo snap install --classic certbot
|
||||||
sudo ln -s /snap/bin/certbot /usr/bin/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
|
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
|
cd /root # Double check this path
|
||||||
|
|
||||||
# Install Node.js
|
# Install Node.js
|
||||||
|
sudo apt install build-essential -y
|
||||||
nvm install 20.14.0
|
nvm install 20.14.0
|
||||||
npm install -g node-gyp
|
npm install -g node-gyp
|
||||||
|
|
||||||
|
18
test.sh
18
test.sh
@ -1,13 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Get Node IPs
|
# Check if script has ip address as argument
|
||||||
RESOLVED_IPS=$(dig +short hnsdoh.com)
|
if [ -z "$1" ]; then
|
||||||
NODE_IPS=($RESOLVED_IPS)
|
# Get Node IPs
|
||||||
if [ ${#NODE_IPS[@]} -eq 0 ]; then
|
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."
|
echo "No IP addresses resolved for hnsdoh.com. Exiting."
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
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
|
# Define the domain and host for kdig commands
|
||||||
TLS_HOST="hnsdoh.com"
|
TLS_HOST="hnsdoh.com"
|
||||||
|
Loading…
Reference in New Issue
Block a user