aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-10-07 21:40:32 +0200
committerJakob Unterwurzacher2015-10-07 21:49:38 +0200
commitbef73c63b35f992b0c9f32aa9b0b0da669b22a43 (patch)
tree506aff73e830ea4e4e1edfe65c4e0619296bb191
parent65ba0739d5de756a437e0f840649583fa835a560 (diff)
Move gocryptfs wrapper into the same folder as the binary
l---------[-rwxr-xr-x]gocryptfs27
-rwxr-xr-xgocryptfs_main/gocryptfs29
2 files changed, 30 insertions, 26 deletions
diff --git a/gocryptfs b/gocryptfs
index b3f4ef3..2e2bf98 100755..120000
--- a/gocryptfs
+++ b/gocryptfs
@@ -1,26 +1 @@
-#!/bin/bash
-
-# Shell wrapper that runs the gocryptfs process in the background
-# and exits on SIGUSR1
-
-set -eu
-
-trap "exit 0" SIGUSR1
-shopt -u huponexit
-
-dir=$(dirname "$0")
-main="$dir/gocryptfs_main/gocryptfs_main"
-
-if [ ! -x $main ]; then
- echo "Error: gocryptfs_main executable not found. Run ./all.bash to build it."
- exit 1
-fi
-
-# A backgrounded process gets /dev/null as stdin per default.
-# Explicitly set stdin to the current stdin so we can ask the user for input.
-"$main" $* < /proc/self/fd/0 & wait
-# The "& wait" is neccessary because bash only processes signals when
-# executing internal commands
-
-# We did not get USR1 - something went wrong
-exit 1
+gocryptfs_main/gocryptfs \ No newline at end of file
diff --git a/gocryptfs_main/gocryptfs b/gocryptfs_main/gocryptfs
new file mode 100755
index 0000000..7b61e60
--- /dev/null
+++ b/gocryptfs_main/gocryptfs
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Shell wrapper that runs the gocryptfs process in the background
+# and exits on SIGUSR1
+
+set -eu
+
+trap "exit 0" SIGUSR1
+shopt -u huponexit
+
+dir=$(dirname $(readlink -f "$0"))
+main="$dir/gocryptfs_main"
+
+# echo "0=$0 dir=$dir main=$main"
+
+if [ ! -x "$main" ]
+then
+ echo "Error: gocryptfs_main executable not found. Run ./all.bash to build it."
+ exit 1
+fi
+
+# A backgrounded process gets /dev/null as stdin per default.
+# Explicitly set stdin to the current stdin so we can ask the user for input.
+"$main" $* < /proc/self/fd/0 & wait
+# The "& wait" is neccessary because bash only processes signals when
+# executing internal commands
+
+# We did not get USR1 - something went wrong
+exit 1