From 1c2888ab9f6b444a4970ba08cc611a3cb2ad9610 Mon Sep 17 00:00:00 2001 From: Justin Reichardt Date: Sun, 12 Jun 2022 20:45:34 -0500 Subject: [PATCH] When install check for systemd sym links before making them --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 93265df..7bf33e6 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,15 @@ build-win: install: build install -D $(PROJROOT)build/bin/rhosts $(BINDIR)/ cp -r $(PROJROOT)build/share/rhosts $(DATADIR) - ln -s $(DATADIR)rhosts/systemd/rhosts.service /usr/lib/systemd/system/rhosts.service - ln -s $(DATADIR)rhosts/systemd/rhosts.path /usr/lib/systemd/system/rhosts.path - ln -s $(DATADIR)rhosts/systemd/rhosts.timer /usr/lib/systemd/system/rhosts.timer + if [ ! -h /usr/lib/systemd/system/rhosts.service ]; then \ + ln -s $(DATADIR)rhosts/systemd/rhosts.service /usr/lib/systemd/system/rhosts.service \ + ;fi + if [ ! -h /usr/lib/systemd/system/rhosts.path ]; then \ + ln -s $(DATADIR)rhosts/systemd/rhosts.path /usr/lib/systemd/system/rhosts.path \ + ;fi + if [ ! -h /usr/lib/systemd/system/rhosts.timer ]; then \ + ln -s $(DATADIR)rhosts/systemd/rhosts.timer /usr/lib/systemd/system/rhosts.timer \ + ;fi uninstall: if [ -f $(BINDIR)/rhosts ]; then \ rm $(BINDIR)/rhosts \