Add FreeBSD; change README to use json-pp for Ubuntu
This commit is contained in:
parent
22e9da2d79
commit
2afdf5043c
3 changed files with 55 additions and 1 deletions
|
@ -15,6 +15,7 @@ EXTRA_DIST = \
|
|||
sample-etc_dhclient-exit-hooks \
|
||||
sample-etc_dhcpc_dhcpcd-eth0.exe \
|
||||
sample-etc_ppp_ip-up.local \
|
||||
sample-etc_rc.d_ddclient.freebsd \
|
||||
sample-etc_rc.d_init.d_ddclient \
|
||||
sample-etc_rc.d_init.d_ddclient.alpine \
|
||||
sample-etc_rc.d_init.d_ddclient.lsb \
|
||||
|
|
24
README.md
24
README.md
|
@ -141,7 +141,7 @@ make sure you have perl and the required modules installed
|
|||
|
||||
if you plan to use cloudflare or feedns you need the perl json module
|
||||
|
||||
apt-get install libjson-any-perl
|
||||
apt-get install libjson-pp-perl
|
||||
|
||||
for IPv6 you also need to instal the perl io-socker-inet6 module
|
||||
|
||||
|
@ -151,6 +151,28 @@ start the first time by hand
|
|||
|
||||
service ddclient start
|
||||
|
||||
### FreeBSD style rc files and daemon mode
|
||||
|
||||
mkdir -p /usr/local/etc/rc.d
|
||||
cp sample-etc_rc.d_ddclient.freebsd /usr/local/etc/rc.d/ddclient
|
||||
|
||||
enable automatic startup when booting
|
||||
|
||||
sysrc ddclient_enable=YES
|
||||
|
||||
make sure you have perl and the required modules installed
|
||||
|
||||
pkg install perl5 p5-Data-Validate-IP p5-IO-Socket-SSL
|
||||
|
||||
if you plan to use cloudflare or feedns you need the perl json module
|
||||
|
||||
pkg install p5-JSON-PP
|
||||
|
||||
start the service manually for the first time
|
||||
|
||||
service ddclient start
|
||||
|
||||
|
||||
If you are not using daemon-mode, configure cron and dhcp or ppp as described below.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
31
sample-etc_rc.d_ddclient.freebsd
Executable file
31
sample-etc_rc.d_ddclient.freebsd
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
# PROVIDE: ddclient
|
||||
# REQUIRE: LOGIN
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
||||
# to enable this service:
|
||||
#
|
||||
# ddclient_enable (bool): Set to NO by default.
|
||||
# Set it to YES to enable ddclient.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=ddclient
|
||||
rcvar=ddclient_enable
|
||||
ddclient_conf="/etc/ddclient/ddclient.conf"
|
||||
|
||||
command="/usr/local/sbin/${name}"
|
||||
load_rc_config $name
|
||||
|
||||
delay=$(grep -v '^\s*#' "${ddclient_conf}" | grep -i -m 1 "daemon" | awk -F '=' '{print $2}')
|
||||
|
||||
if [ -z "${delay}" ]
|
||||
then
|
||||
ddclient_flags="-daemon 300"
|
||||
else
|
||||
ddclient_flags=""
|
||||
fi
|
||||
|
||||
run_rc_command "$1"
|
Loading…
Reference in a new issue