From a81bfa2e4462b0dfa9c4b90322db1aca826c6e06 Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Wed, 24 Feb 2016 14:11:27 -0600 Subject: [PATCH] Add configure ddclient to automatically report back IP address --- configure_ddclient.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 configure_ddclient.sh diff --git a/configure_ddclient.sh b/configure_ddclient.sh new file mode 100644 index 0000000..4c3da97 --- /dev/null +++ b/configure_ddclient.sh @@ -0,0 +1,43 @@ +#!/bin/bash +clear +echo "Script to configure ddclient to work with *.poconsole.net" +echo "Written by Patrick McDonagh" +sleep 1 + +if [[ $EUID -ne 0 ]]; then + echo "HEY! This script must be run as root!" 1>&2 + exit 1 +fi + +echo "Are you sure you want to run the script? [y/n]" +read run_start + +if [ "$run_start" = "y" ]; then + echo "Making sure ddclient is installed..." + echo "While that's happening check http://domains.google.com for the username and password" + apt-get install ddclient + clear + echo "Ok, on to the good stuff... Let's get configured!" + echo "Enter the generated username:" + read username + echo "Enter the generated password:" + read password + echo "Enter the well name:" + read well_name + echo "Enter the company identifier:" + read company_ident + + echo "protocol=dyndns2" > ddclient.conf + echo "use=web" >> ddclient.conf + echo "server=domains.google.com" >> ddclient.conf + echo "ssl=yes" >> ddclient.conf + echo "login=$username" >> ddclient.conf + echo "password=$password" >> ddclient.conf + echo "$well_name.$company_ident.poconsole.net" >> ddclient.conf + + mv ddclient.conf /etc/ + ddclient > ddclient.log + +else + echo "Your loss... I was going to do some cool stuff..." +fi