-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·36 lines (28 loc) · 1.01 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -euo pipefail
readonly version="1.0.1"
# Read the userName
read -p "Enter your NoIP.com userName: " userName
# Read the password, suppressing the input and displaying a prompt message
read -s -p "Enter your NoIP.com password: " password
# Print a newline after the password is entered
echo
# Read the hostName
read -p "Enter your NoIP.com hostName: " hostName
# Set a default value for the userAgent
userAgent="NameOfUpdateProgram/VersionNumber maintainercontact@domain.com"
# Read the userAgent, if provided
read -p "Enter your userAgent ($userAgent): " -r userInput
# If the user provided an input, use it
if [ -n "$userInput" ]; then
userAgent="$userInput"
fi
wget -O ~/noip.jar \
https://github.com/davidecolombo/noip/releases/download/v${version}/noip-${version}.jar && \
echo "{
\"userName\": \"${userName}\",
\"password\": \"${password}\",
\"hostName\": \"${hostName}\",
\"userAgent\": \"${userAgent}\"
}" > ~/settings.json && \
java -cp ~/noip.jar space.davidecolombo.noip.App -settings ~/settings.json