summaryrefslogtreecommitdiffstats
path: root/filehooker/root-image/krebs/bin/tor_announce.ship
blob: ec4f33b6a5de09b307009c240f82a3517b4f3703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#@include core
. /krebs/lib/core
#@include network
. /krebs/lib/network
#@include tor
. /krebs/lib/tor

sleep_time=5
test -w "$torrc" || ( error "$torrc is not writable!"; exit 1 ) || exit 1

configure_hidden_service
test ! -e $hidden_service_dir/hostname && \
  info "hidden service file does not exist, restarting tor" && \
  systemctl restart tor && \
  sleep 1

while ! internet;do
  info "no internet yet, sleeping"
  sleep $sleep_time
done

NICK=$(get_hostname)
cat "$hidden_service_dir/hostname" | send_irc