From d69c0fce3c6550a0dd204be79606d1f053038137 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 28 Oct 2017 23:31:00 +0200 Subject: bugfixes --- Makefile | 20 ++++++++++++++++++-- cryptfs.bin.in | 6 +++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a793d83..9e817fd 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,11 @@ DESTDIR = BINDIR = /usr/bin DEVDIR = /dev ETCDIR = /etc -UUIDDIR = $(DEVDIR)/disk/by-uuid MAPDIR = $(DEVDIR)/mapper RCDDIR = $(ETCDIR)/rc.d SYSTEMDDIR = /usr/lib/systemd/system +UUIDDIR = $(DEVDIR)/disk/by-uuid + CONF_PREFIXES = VERSION = 0.4 @@ -34,7 +35,22 @@ VERSION = 0.4 all: cryptfs.bin cryptfs.rc cryptfs.service %: %.in - sed "s/#VERSION#/$(VERSION)/; s@#DEVDIR#@$(DEVDIR)@; s@#ETCDIR#@$(ETCDIR)@; s@#UUIDDIR#@$(UUIDDIR)@; s@#MAPDIR#@$(MAPDIR)@; s@#RCDDIR#@$(RCDDIR)@; s@#CONF_PREFIXES#@$(CONF_PREFIXES)@" $< > $@ + sed " \ + s@#BINDIR#@$(BINDIR)@; \ + s@#DEVDIR#@$(DEVDIR)@; \ + s@#ETCDIR#@$(ETCDIR)@; \ + s@#MAPDIR#@$(MAPDIR)@; \ + s@#RCDDIR#@$(RCDDIR)@; \ + s@#SYSTEMDDIR#@$(SYSTEMDDIR)@; \ + s@#UUIDDIR#@$(UUIDDIR)@; \ + s@#CONF_PREFIXES#@$(CONF_PREFIXES)@; \ + s@#VERSION#@$(VERSION)@; \ + " $< | \ + if which "ping6" >/dev/null 2>&1; then \ + sed 's@#PING6#@ping6@'; \ + else \ + sed 's@#PING6#@ping -6@'; \ + fi > $@ [ "$@" = "cryptfs.bin" ] && chmod +x "$@" || true [ "$@" = "cryptfs.rc" ] && chmod +x "$@" || true diff --git a/cryptfs.bin.in b/cryptfs.bin.in index fde3bd0..9ef4245 100644 --- a/cryptfs.bin.in +++ b/cryptfs.bin.in @@ -162,11 +162,11 @@ do_mount() { max_wait=$(($(date +%s)+120)) host=$( mount_details dev "$1" | \ - sed 's>^\([^:@]*@\)\?\([^:@]\+\):\S*$>\2>" + sed 's>^\([^:@]*@\)\?\([^:@]\+\):\S*$>\2>' ) while [ $(date +%s) -lt ${max_wait} ] && \ - ! /bin/ping6 -c1 ${host} >/dev/null 2>&1 && \ - ! /bin/ping -c1 ${host} >/dev/null 2>&1; do + ! #PING6# -c1 "${host}" >/dev/null 2>&1 && \ + ! ping -c1 "${host}" >/dev/null 2>&1; do >&2 printf ',' sleep 1 done -- cgit v1.2.3-70-g09d2