Loading PKGBUILD +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package() { install -m644 COPYRIGHT LICENSE "$pkgdir/usr/share/licenses/$pkgname" # install binaries install -m755 atc aurdown go2chroot addpkg sign archbuild-dl pkgbuild2json \ tmpmakepkg reinstallpkgs "$pkgdir/usr/bin" tmpmakepkg reinstallpkgs restart-updated-service "$pkgdir/usr/bin" } # vim:set ts=2 sw=2 et: restart-updated-service 0 → 100755 +18 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright © Sébastien Luttringer # Restart running systemd service if a new binary is available (( $UID != 0 )) && echo 'You need to be root' && exit 1 declare -a services services=($(systemctl -t service --full|grep \.service|grep running|sed -rn 's/^(.*\.service).*/\1/p')) for svc in "${services[@]}"; do pid=$(systemctl show "$svc"|sed -nr 's/^MainPID=(.*)/\1/p') if readlink "/proc/$pid/exe"|grep -q '(deleted)'; then echo systemctl restart "$svc" [[ $1 == '-f' ]] && systemctl restart "$svc" fi done [[ -t 2 && $1 != '-f' ]] && echo 'Use -f to execute' >&2 || : Loading
PKGBUILD +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package() { install -m644 COPYRIGHT LICENSE "$pkgdir/usr/share/licenses/$pkgname" # install binaries install -m755 atc aurdown go2chroot addpkg sign archbuild-dl pkgbuild2json \ tmpmakepkg reinstallpkgs "$pkgdir/usr/bin" tmpmakepkg reinstallpkgs restart-updated-service "$pkgdir/usr/bin" } # vim:set ts=2 sw=2 et:
restart-updated-service 0 → 100755 +18 −0 Original line number Diff line number Diff line #!/bin/bash # Copyright © Sébastien Luttringer # Restart running systemd service if a new binary is available (( $UID != 0 )) && echo 'You need to be root' && exit 1 declare -a services services=($(systemctl -t service --full|grep \.service|grep running|sed -rn 's/^(.*\.service).*/\1/p')) for svc in "${services[@]}"; do pid=$(systemctl show "$svc"|sed -nr 's/^MainPID=(.*)/\1/p') if readlink "/proc/$pid/exe"|grep -q '(deleted)'; then echo systemctl restart "$svc" [[ $1 == '-f' ]] && systemctl restart "$svc" fi done [[ -t 2 && $1 != '-f' ]] && echo 'Use -f to execute' >&2 || :