-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
python3 /usr/local/cloudns-ddns-client/src/main.py "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
echo 'Installing ClouDNS DyDNS Update Client' | ||
|
||
# TODO - version argument | ||
# TODO - argument to install from local repo(no git clone) | ||
|
||
# TODO - install deps. for other OSes | ||
if [[ "$1" == "--install-apt-deps" ]]; then | ||
echo 'Installing apt dependencies' | ||
{ | ||
apt install python3-pip -y && \ | ||
apt install python3-venv -y | ||
} || { | ||
echo 'Failed to install Torch Tuner CLI apt dependencies' && \ | ||
exit 1 | ||
} | ||
|
||
fi | ||
|
||
cd /usr/local || (mkdir -p /usr/local && (cd /usr/local || (echo 'failed to create install directory at /usr/local' && exit 1))) | ||
|
||
if [ -d ./cloudns-ddns-client ]; then | ||
echo "Removing old update client install" | ||
{ | ||
rm -rf ./torch-tuner | ||
} || { | ||
echo 'Failed to remove old update client install' && \ | ||
exit 1 | ||
} | ||
fi | ||
|
||
{ | ||
git clone https://github.com/rjojjr/cloudns-ddns-client.git | ||
} || { | ||
echo 'Failed to clone update client' && \ | ||
exit 1 | ||
} | ||
|
||
{ | ||
cd cloudns-ddns-client | ||
} || { | ||
echo 'Failed to navigate to cloudns-ddns-client directory' && \ | ||
exit 1 | ||
} | ||
|
||
{ | ||
echo 'Installing update client as system wide application' && \ | ||
cp scripts/cloudns-client /bin/cloudns-client && \ | ||
sudo chmod +x /bin/cloudns-client | ||
} || { | ||
echo 'Failed to install update client as system wide application' && \ | ||
exit 1 | ||
} | ||
|
||
{ | ||
echo 'Installing update client systemd service' && \ | ||
cp svc/cloudns-ddns-update-client.service /etc/systemd/system/ && \ | ||
sudo systemctl enable cloudns-ddns-update-client.service && \ | ||
sudo systemctl start cloudns-ddns-update-client.service | ||
} || { | ||
echo 'Failed to install update client service' && \ | ||
exit 1 | ||
} | ||
|
||
echo 'ClouDNS DyDNS Update Client installed successfully!' |