Skip to content

Fix install script #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ archives:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-snapshot-{{ .ShortCommit }}'
version_template: '{{ .Tag }}-snapshot-{{ .ShortCommit }}'
changelog:
sort: asc
filters:
Expand Down
10 changes: 6 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ if [ -z "${BASH}" ]; then
exit 1
fi

aptget="$(command -v apt-get || true)"
aptdcon="$(command -v aptdcon || true)"
dpkg="$(command -v dpkg || true)"
pkexec="$(command -v pkexec || true)"

if [[ ! -x "${aptdcon}" && ! -x "${dpkg}" ]]; then
if [[ ! -x "${aptdcon}" && ! -x "${aptget}" ]]; then
echo >&2 Install only runs on Debian based distributions.
exit 2
fi
Expand All @@ -25,6 +25,7 @@ ldddns_install() {
rm --recursive --force -- "${tmpdir}"
}
trap cleanup EXIT
setfacl -m u:_apt:rx "${tmpdir}"

echo -n "Finding latest package name..."

Expand All @@ -38,12 +39,13 @@ ldddns_install() {
curl --proto =https --fail --location --progress-bar --output "${tmpdir}/${package}" "https://github.com/arnested/ldddns/releases/latest/download/${package}"

echo "Installing ${package}..."

if [[ -x "${aptdcon}" ]]; then
yes | aptdcon --hide-terminal --install "${tmpdir}/${package}" > /dev/null
elif [[ -x "${pkexec}" ]]; then
pkexec dpkg --install "${tmpdir}/${package}"
pkexec apt-get install "${tmpdir}/${package}"
else
sudo dpkg --install "${tmpdir}/${package}"
sudo apt-get install "${tmpdir}/${package}"
fi
}

Expand Down
1 change: 1 addition & 0 deletions systemd/ldddns.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Description=Local Docker Development DNS
Documentation=https://ldddns.arnested.dk
BindTo=docker.service
After=docker.service
Requisite=avahi-daemon

[Service]
Type=notify
Expand Down