-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgen_readme.sh
executable file
·40 lines (30 loc) · 1002 Bytes
/
gen_readme.sh
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
#!/bin/sh
D="$(dirname $0)"
README="$(dirname $0)/README.md"
cat > $README <<-_EOF
## $(egrep "^# " $D/synoadm.sh |sed 's/# /\n/g' |tail -n +2)
### Usage
\`\`\`bash
$ synoadm
$($D/synoadm.sh |sed s/synoadm.sh/synoadm/)
\`\`\`
### Example usage for push_ssl_cert
\`\`\`bash
laptop $ synoadm 192.168.1.5 push_ssl_cert /tmp/domain.fullchain.pem /tmp/domain.key
$ openssl x509 -in /tmp/domain.fullchain.pem -text
$ openssl rsa -in /tmp/domain.key -text
writing RSA key
$ ssh [email protected] uname -ap
$ ssh [email protected] cat > /usr/syno/etc/certificate/_archive/yoUheE/fullchain.pem
$ ssh [email protected] cat > /usr/syno/etc/certificate/_archive/yoUheE/privkey.pem
$ ssh [email protected] chmod 600 /usr/syno/etc/certificate/_archive/yoUheE/privkey.pem
$ ssh [email protected] /usr/syno/bin/synosystemctl restart nginx
[nginx] restarted.
[*] done, 192.168.1.5 now uses new SSL certificates
\`\`\`
### Installation
\`\`\`bash
$ sudo make install
\`\`\`
_EOF
echo "[*] DONE, generated $README"