# install default config if such doesn't exist
@if [ ! -f "$(DESTDIR)/etc/vnstat.conf" ]; \
then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \
- install -D -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
+ install -d -m 755 $(DESTDIR)/etc; \
+ install -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
fi
# install everything else
install -m 644 man/vnstati.1 $(MAN)/man1; \
fi
- @if [ -f $(MAN)/man1/vnstat.1.gz ]; \
+ @if [ -f "$(MAN)/man1/vnstat.1.gz" ]; \
then gzip -f9 $(MAN)/man1/vnstat.1; \
gzip -f9 $(MAN)/man1/vnstatd.1; \
gzip -f9 $(MAN)/man5/vnstat.conf.5; \
fi
# remove vnstat.conf.1 is such exists in the wrong place
- @if [ -f $(MAN)/man1/vnstat.conf.1.gz ]; \
+ @if [ -f "$(MAN)/man1/vnstat.conf.1.gz" ]; \
then rm -f $(MAN)/man1/vnstat.conf.1.gz; \
fi
- @if [ -f $(MAN)/man1/vnstat.conf.1 ]; \
+ @if [ -f "$(MAN)/man1/vnstat.conf.1" ]; \
then rm -f $(MAN)/man1/vnstat.conf.1; \
fi
fi
# install default config if such doesn't exist
- @if [ ! -f $(DESTDIR)/etc/vnstat.conf ]; \
+ @if [ ! -f "$(DESTDIR)/etc/vnstat.conf" ]; \
then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \
install -d -m 755 $(DESTDIR)/etc; \
install -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
fi
# remove vnstat.conf.1 is such exists in the wrong place
- @if [ -f $(MAN_BSD)/man1/vnstat.conf.1.gz ]; \
+ @if [ -f "$(MAN_BSD)/man1/vnstat.conf.1.gz" ]; \
then rm -f $(MAN_BSD)/man1/vnstat.conf.1.gz; \
fi
- @if [ -f $(MAN_BSD)/man1/vnstat.conf.1 ]; \
+ @if [ -f "$(MAN_BSD)/man1/vnstat.conf.1" ]; \
then rm -f $(MAN_BSD)/man1/vnstat.conf.1; \
fi