aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-10-08 00:02:55 +0200
committerJakob Unterwurzacher2015-10-08 00:02:55 +0200
commita3e66ca154f3a7f4141cc68f53d3199859506768 (patch)
treebbc7ae213bc8c51ffb638e2d81465d292314be9d
parent7ac9d6af58004ef47901539c9743116b0ef35df1 (diff)
Shell wrapper: Also search the binary in $GOPATH/bin
-rw-r--r--README.md2
-rwxr-xr-xgocryptfs_main/gocryptfs10
2 files changed, 8 insertions, 4 deletions
diff --git a/README.md b/README.md
index 5a2f368..3c3bfdf 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ Current Status
Install
-------
- $ go get github.com/rfjakob/gocryptfs/...
+ $ go get github.com/rfjakob/gocryptfs/gocryptfs_main
(The dots are important!)
diff --git a/gocryptfs_main/gocryptfs b/gocryptfs_main/gocryptfs
index 7b61e60..a297cf2 100755
--- a/gocryptfs_main/gocryptfs
+++ b/gocryptfs_main/gocryptfs
@@ -1,7 +1,9 @@
#!/bin/bash
-# Shell wrapper that runs the gocryptfs process in the background
+# Wrapper that runs the gocryptfs process in the background
# and exits on SIGUSR1
+#
+# Written in shell because Go does not support daemonization natively
set -eu
@@ -11,8 +13,10 @@ shopt -u huponexit
dir=$(dirname $(readlink -f "$0"))
main="$dir/gocryptfs_main"
-# echo "0=$0 dir=$dir main=$main"
-
+if [ ! -x "$main" ]
+then
+ main="$GOPATH/bin/gocryptfs_main"
+fi
if [ ! -x "$main" ]
then
echo "Error: gocryptfs_main executable not found. Run ./all.bash to build it."