Add ddclient LXC container
This commit is contained in:
parent
1e3c7caea8
commit
549faf28d4
46
ct/ddclient.sh
Normal file
46
ct/ddclient.sh
Normal file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
||||
# Copyright (c) 2026 mitchscobell
|
||||
# Author: mitchscobell
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://ddclient.net/
|
||||
|
||||
APP="ddclient"
|
||||
var_tags="${var_tags:-network}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -f /etc/ddclient.conf ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating ${APP}"
|
||||
$STD apt-get update
|
||||
$STD apt-get install --only-upgrade -y ddclient
|
||||
$STD systemctl restart ddclient
|
||||
msg_ok "Updated ${APP}"
|
||||
msg_ok "Updated successfully!"
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Configuration file location:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}/etc/ddclient.conf${CL}"
|
||||
48
frontend/public/json/ddclient.json
Normal file
48
frontend/public/json/ddclient.json
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "ddclient",
|
||||
"slug": "ddclient",
|
||||
"categories": [
|
||||
4
|
||||
],
|
||||
"date_created": "2026-01-31",
|
||||
"type": "ct",
|
||||
"updateable": true,
|
||||
"privileged": false,
|
||||
"interface_port": null,
|
||||
"documentation": "https://ddclient.net/",
|
||||
"website": "https://ddclient.net/",
|
||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/ddclient.webp",
|
||||
"config_path": "/etc/ddclient.conf",
|
||||
"description": "ddclient is a Perl client used to update dynamic DNS entries for accounts on a wide range of dynamic DNS service providers. It supports multiple protocols and providers, allowing automatic IP address updates for your domain names.",
|
||||
"install_methods": [
|
||||
{
|
||||
"type": "default",
|
||||
"script": "ct/ddclient.sh",
|
||||
"resources": {
|
||||
"cpu": 1,
|
||||
"ram": 512,
|
||||
"hdd": 2,
|
||||
"os": "debian",
|
||||
"version": "13"
|
||||
}
|
||||
}
|
||||
],
|
||||
"default_credentials": {
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": [
|
||||
{
|
||||
"type": "info",
|
||||
"text": "After installation, edit `/etc/ddclient.conf` with your dynamic DNS provider credentials"
|
||||
},
|
||||
{
|
||||
"type": "info",
|
||||
"text": "Sample configuration is created for Namecheap but can be modified for other providers"
|
||||
},
|
||||
{
|
||||
"type": "info",
|
||||
"text": "The configuration file is set to chmod 600 for security"
|
||||
}
|
||||
]
|
||||
}
|
||||
44
install/ddclient-install.sh
Normal file
44
install/ddclient-install.sh
Normal file
@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2026 mitchscobell
|
||||
# Author: mitchscobell
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://ddclient.net/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing ddclient"
|
||||
DEBIAN_FRONTEND=noninteractive $STD apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install -y ddclient
|
||||
msg_ok "Installed ddclient"
|
||||
|
||||
if [[ ! -f /etc/ddclient.conf ]]; then
|
||||
msg_info "Creating sample ddclient configuration"
|
||||
cat << 'EOF' >/etc/ddclient.conf
|
||||
# Sample ddclient.conf
|
||||
# Replace with your actual settings
|
||||
protocol=namecheap
|
||||
use=web, web=dynamicdns.park-your-domain.com/getip
|
||||
server=dynamicdns.park-your-domain.com
|
||||
login=yourdomain.com
|
||||
password='your-ddns-password'
|
||||
@,www
|
||||
EOF
|
||||
chmod 600 /etc/ddclient.conf
|
||||
msg_ok "Sample /etc/ddclient.conf created"
|
||||
fi
|
||||
|
||||
msg_info "Enabling ddclient service"
|
||||
systemctl enable -q --now ddclient
|
||||
msg_ok "ddclient service enabled and started"
|
||||
|
||||
motd_ssh
|
||||
echo -e "echo -e \" 🔧 \\\\033[1;33m Configuration: \\\\033[1;32m/etc/ddclient.conf\\\\033[0m\"" >>/etc/profile.d/00_lxc-details.sh
|
||||
echo "echo \"\"" >>/etc/profile.d/00_lxc-details.sh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Loading…
x
Reference in New Issue
Block a user