aboutsummaryrefslogtreecommitdiff
path: root/gocryptfs
blob: ce15b974851ed8145c433563a2e68f191fbe58c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Simple wrapper that runs the gocryptfs process in the background

set -eu

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

# This needs user input and cannot run in the background
if [[ $* == *--init* ]]; then
	"$main" $*
else
	"$main" $* &
	sleep 0.1
	disown
fi