From 71932ec16b8425651a72f37b9e19b686a44edb75 Mon Sep 17 00:00:00 2001 From: tengel Date: Wed, 20 Mar 2024 08:41:22 -0500 Subject: [PATCH] Adding custom systemd unit --- vpn-unlimited/PKGBUILD | 15 ++++++++++----- vpn-unlimited/vpn-unlimited-daemon.service | 11 +++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 vpn-unlimited/vpn-unlimited-daemon.service diff --git a/vpn-unlimited/PKGBUILD b/vpn-unlimited/PKGBUILD index 3a37b41..085f37d 100644 --- a/vpn-unlimited/PKGBUILD +++ b/vpn-unlimited/PKGBUILD @@ -2,15 +2,17 @@ pkgname=vpn-unlimited pkgver=2.4.0 -pkgrel=1 +pkgrel=2 pkgdesc="VPN client for the VPN Unlimited service" arch=('x86_64') url="https://www.vpnunlimitedapp.com/downloadlinux" license=('custom') options=('emptydirs') depends=('qt4' 'libssh2' 'libcurl-compat') -source=("http://apt.simplexsolutionsinc.com/repository/pool/main/v/vpn-unlimited/${pkgname}_${pkgver}_amd64.deb") -md5sums=('0d14a75000af104c88247f5915dfad40') +source=("http://apt.simplexsolutionsinc.com/repository/pool/main/v/vpn-unlimited/${pkgname}_${pkgver}_amd64.deb" + "vpn-unlimited-daemon.service") +md5sums=('0d14a75000af104c88247f5915dfad40' + '7c3269456d352df8d676c722058b5067') package() { # Unpack the vendor package @@ -28,7 +30,10 @@ package() { # Alter the desktop file to launch our script instead sed -i 's/Exec=vpn-unlimited/Exec=vpnu-arch/g' "${pkgdir}/usr/share/applications/vpn-unlimited.desktop" - # Save this for conversion to a systemd unit some day - cp -p "${srcdir}/etc/init.d/vpn-unlimited-daemon" "${pkgdir}/usr/share/doc/vpn-unlimited/" + # Add our custom systemd unit + install -Dm0644 "${srcdir}/vpn-unlimited-daemon.service" "${pkgdir}/lib/systemd/system/vpn-unlimited-daemon.service" + + # Save this original file + cp -p "${srcdir}/etc/init.d/vpn-unlimited-daemon" "${pkgdir}//usr/share/doc/vpn-unlimited/" } diff --git a/vpn-unlimited/vpn-unlimited-daemon.service b/vpn-unlimited/vpn-unlimited-daemon.service new file mode 100644 index 0000000..1463238 --- /dev/null +++ b/vpn-unlimited/vpn-unlimited-daemon.service @@ -0,0 +1,11 @@ +[Unit] +Description=VPN Unlimited daemon +After=network.target + +[Service] +Type=simple +PIDFile=/var/run/vpn-unlimited-daemon.pid +ExecStart=/usr/bin/vpn-unlimited-daemon + +[Install] +WantedBy=multi-user.target