Files
POConsole-Autoconfig/configure_ddclient.sh

44 lines
1.2 KiB
Bash

#!/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