-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSERVE
More file actions
executable file
·34 lines (25 loc) · 725 Bytes
/
Copy pathSERVE
File metadata and controls
executable file
·34 lines (25 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
set -m # super important
cd "$(dirname "$0")"
if ! which php >/dev/null; then echo Error: could not find php program binary. Please install PHP.; exit 1; fi
if ! which tor >/dev/null; then echo Error: could not find tor program binary. Please install TOR.; exit 1; fi
rm -f .tlb/tor-hidden-service/hostname
./SERVE_INIT_STORAGE
./STOP_RUNNING
./SERVE_PICK_HTTP_ADDRESS .tlb localhost 8000
./SERVE_PHP &
./SERVE_TOR &
sleep 1
for n in 0 1 1 2 2 2 2 2 2; do
if [ -e .tlb/php.pid -a -e .tlb/tor.pid -a -e .tlb/http_address -a -e .tlb/tor-hidden-service/hostname ]; then
break
fi
echo -n .
sleep $n
done
echo
./SERVE_SHOW_ADDRESSES
echo The service is running...
wait
echo The service has quit.