-
Notifications
You must be signed in to change notification settings - Fork 2
/
dnscrypt-cache
executable file
·58 lines (49 loc) · 1.91 KB
/
dnscrypt-cache
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/system/bin/sh
set -e
CONFIG_DIR=/etc/dnscrypt-proxy
CACHE_DIR=/data/local/tmp/dnscrypt-proxy
if [ ! -d "$CACHE_DIR" ]; then
mkdir -p -m 01755 "$CACHE_DIR"
chown nobody:nobody "$CACHE_DIR"
fi
if [ ! -f "$CACHE_DIR"/public-resolvers.md ]; then
cp "$CONFIG_DIR"/public-resolvers.md "$CACHE_DIR"/
cp "$CONFIG_DIR"/public-resolvers.md.minisig "$CACHE_DIR"/
chmod 600 "$CACHE_DIR"/public-resolvers.md
chmod 600 "$CACHE_DIR"/public-resolvers.md.minisig
chown nobody:nobody "$CACHE_DIR"/public-resolvers.md
chown nobody:nobody "$CACHE_DIR"/public-resolvers.md.minisig
fi
if [ ! -f "$CACHE_DIR"/relays.md ]; then
cp "$CONFIG_DIR"/relays.md "$CACHE_DIR"/
cp "$CONFIG_DIR"/relays.md.minisig "$CACHE_DIR"/
chmod 600 "$CACHE_DIR"/relays.md
chmod 600 "$CACHE_DIR"/relays.md.minisig
chown nobody:nobody "$CACHE_DIR"/relays.md
chown nobody:nobody "$CACHE_DIR"/relays.md.minisig
fi
if [ ! -f "$CACHE_DIR"/odoh-servers.md ]; then
cp "$CONFIG_DIR"/odoh-servers.md "$CACHE_DIR"/
cp "$CONFIG_DIR"/odoh-servers.md.minisig "$CACHE_DIR"/
chmod 600 "$CACHE_DIR"/odoh-servers.md
chmod 600 "$CACHE_DIR"/odoh-servers.md.minisig
chown nobody:nobody "$CACHE_DIR"/odoh-servers.md
chown nobody:nobody "$CACHE_DIR"/odoh-servers.md.minisig
fi
if [ ! -f "$CACHE_DIR"/odoh-relays.md ]; then
cp "$CONFIG_DIR"/odoh-relays.md "$CACHE_DIR"/
cp "$CONFIG_DIR"/odoh-relays.md.minisig "$CACHE_DIR"/
chmod 600 "$CACHE_DIR"/odoh-relays.md
chmod 600 "$CACHE_DIR"/odoh-relays.md.minisig
chown nobody:nobody "$CACHE_DIR"/odoh-relays.md
chown nobody:nobody "$CACHE_DIR"/odoh-relays.md.minisig
fi
if [ ! -f "$CACHE_DIR"/onion-services.md ]; then
cp "$CONFIG_DIR"/onion-services.md "$CACHE_DIR"/
cp "$CONFIG_DIR"/onion-services.md.minisig "$CACHE_DIR"/
chmod 600 "$CACHE_DIR"/onion-services.md
chmod 600 "$CACHE_DIR"/onion-services.md.minisig
chown nobody:nobody "$CACHE_DIR"/onion-services.md
chown nobody:nobody "$CACHE_DIR"/onion-services.md.minisig
fi
exit 0