systemd migration

This commit is contained in:
thomas 2022-03-22 22:24:15 +01:00
parent a20c6440ee
commit 188ffb6c70
17 changed files with 35 additions and 19 deletions

View File

@ -1,32 +1,43 @@
#!/bin/bash #!/bin/bash
VERSION=0.108.0-b.4
RELEASE=1
[ -e ./lib/function.sh ] && source ./lib/function.sh [ -e ./lib/function.sh ] && source ./lib/function.sh
APP=adguardhome APP=adguardhome
DEPOT=https://github.com/AdguardTeam/AdGuardHome.git
VERSION=0.108.0-b.3 GIT_VERSION=v${VERSION}
GIT_VERSION=v$VERSION DEB_VERSION=${VERSION}-${RELEASE}
DEB_VERSION=$VERSION-1
DEBIAN_VERSION_CODENAME=bullseye DEBIAN_VERSION_CODENAME=bullseye
IMAGE_SIZE=4 IMAGE_SIZE=4
STEP="envinit prebuild build makedeb" STEP="envinit prebuild build makedeb"
envinit() { envinit() {
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot if [ $(dpkg -l | grep -e 'ii nodejs ' | wc -l) -eq 1 ];
wget -qO - https://deb.nodesource.com/setup_16.x | bash then
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg apt-get update
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list apt-get dist-upgrade -y
apt-get update else
apt-get install -y nodejs yarn apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz wget -qO - https://deb.nodesource.com/setup_16.x | bash
wget -qO - https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarnkey.gpg
echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" > /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y nodejs yarn
wget -qO - https://go.dev/dl/go1.18.linux-amd64.tar.gz | tar -C /usr/local -xz
fi
} }
prebuild(){ prebuild(){
git clone --depth 1 -b ${GIT_VERSION} https://github.com/AdguardTeam/AdGuardHome.git /tmp/adguardhome [ -e /tmp/git ] && rm -fr /tmp/git
[ -e /tmp/${APP} ] || mkdir /tmp/${APP}
git clone --depth 1 -b ${GIT_VERSION} ${DEPOT} /tmp/git
cp -r /tmp/git/. /tmp/${APP}
} }
build() { build() {
cd /tmp/adguardhome cd /tmp/${APP}
PATH=$PATH:/usr/local/go/bin PATH=$PATH:/usr/local/go/bin
make make
} }

View File

@ -0,0 +1 @@
/etc/defaults/adguardhome

View File

@ -3,5 +3,5 @@ Version: %VERSION%
Section: base Section: base
Priority: optional Priority: optional
Architecture: amd64 Architecture: amd64
Maintainer: Thomas Legay <thomas@syngate.fr> Maintainer: Thomas Legay <thomas@lgy.fr>
Description: adguardhome Description: AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, itll cover ALL your home devices, and you dont need any client-side software for that. With the rise of Internet-Of-Things and connected devices, it becomes more and more important to be able to control your whole network.

View File

@ -0,0 +1,4 @@
# Options to pass to adguardhome
# see /usr/bin/adguardhome --help
ADGH_OPTS=-c /etc/adguardhome.yaml -w /var/lib/adguardhome

View File

@ -4,10 +4,10 @@ ConditionFileIsExecutable=/usr/bin/adguardhome
After=syslog.target network-online.target After=syslog.target network-online.target
[Service] [Service]
EnvironmentFile=-/etc/default/adguardhome EnvironmentFile=/etc/default/adguardhome
StartLimitInterval=5 StartLimitInterval=5
StartLimitBurst=10 StartLimitBurst=10
ExecStart=/usr/bin/adguardhome -c /etc/adguardhome.yaml -w /var/lib/adguardhome ExecStart=/usr/bin/adguardhome $ADGH_OPTS
WorkingDirectory=/var/lib/adguardhome WorkingDirectory=/var/lib/adguardhome
Restart=always Restart=always

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION=10.0.0-rc2 VERSION=10.0.0-rc3
[ -e ./lib/function.sh ] && source ./lib/function.sh [ -e ./lib/function.sh ] && source ./lib/function.sh