Move gocryptfs wrapper into the same folder as the binary
This commit is contained in:
parent
65ba0739d5
commit
bef73c63b3
26
gocryptfs
26
gocryptfs
@ -1,26 +0,0 @@
|
||||
#!/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
|
29
gocryptfs_main/gocryptfs
Executable file
29
gocryptfs_main/gocryptfs
Executable file
@ -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
|
Loading…
x
Reference in New Issue
Block a user