Fix errors in postun/posttrans scriptlets

This commit is contained in:
Matti Viljanen 2022-03-19 23:07:11 +02:00
parent a417c6f5f6
commit 479dfd590b
No known key found for this signature in database
GPG key ID: CF32A1495158F888

View file

@ -74,10 +74,10 @@ desktop-file-install --delete-original \
# << files # << files
%posttrans %posttrans
# Remove old service # Remove old service (quietly)
systemctl stop %{name}.service systemctl stop %{name}.service &>/dev/null
systemctl disable %{name}.service systemctl disable %{name}.service &>/dev/null
rm %{_unitdir}/%{name}.service rm -f %{_unitdir}/%{name}.service
# Install/update permission daemon (root) # Install/update permission daemon (root)
cp %{_datadir}/%{name}/service/%{name}-oneshot.service %{_unitdir}/%{name}-oneshot.service cp %{_datadir}/%{name}/service/%{name}-oneshot.service %{_unitdir}/%{name}-oneshot.service
@ -94,16 +94,16 @@ systemctl-user start %{name}.service
exit 0 exit 0
%postun %postun
// Run on uninstall, not on upgrade # Run on uninstall, not on upgrade
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
systemctl-user stop %{name}.service" systemctl-user stop %{name}.service
systemctl-user disable %{name}.service" systemctl-user disable %{name}.service
rm %{_userunitdir}/%{name}.service rm -f %{_userunitdir}/%{name}.service
systemctl-user daemon-reload" systemctl-user daemon-reload
systemctl stop %{name}-oneshot.service systemctl stop %{name}-oneshot.service
systemctl disable %{name}-oneshot.service systemctl disable %{name}-oneshot.service
rm %{_unitdir}/%{name}-oneshot.service rm -f %{_unitdir}/%{name}-oneshot.service
systemctl daemon-reload systemctl daemon-reload
fi fi
exit 0 exit 0