Skip to content

Commit

Permalink
Merge pull request #360 from arnested/apt-get
Browse files Browse the repository at this point in the history
Fix install script
  • Loading branch information
arnested authored Sep 26, 2024
2 parents 5174af9 + ec454d1 commit 353e6cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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

0 comments on commit 353e6cf

Please sign in to comment.