Skip to content

Commit d175d33

Browse files
authored
Create CLI_icecast_cert_from_certbot.sh
1 parent 8ae92a3 commit d175d33

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

CLI_icecast_cert_from_certbot.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
RED='\033[0;31m'
3+
GREEN='\033[0;32m'
4+
YELLOW='\033[1;33m'
5+
NC='\033[0m' # No Color
6+
7+
OUTPUT=/folder/icecast.pem
8+
9+
echo -e "${YELLOW}Getting Cert and PrivKey from certbot${NC}"
10+
echo ""
11+
12+
CERT=/etc/letsencrypt/live/<domain>/cert.pem
13+
if test -f "$CERT";
14+
then
15+
echo -e "${GREEN}$CERT exist !${NC}"
16+
echo ""
17+
else
18+
echo -e "${RED}$CERT doesn't exist !${NC}"
19+
exit
20+
fi
21+
22+
PRIVKEY=/etc/letsencrypt/live/<domain>/privkey.pem
23+
if test -f "$PRIVKEY";
24+
then
25+
echo -e "${GREEN}$PRIVKEY exist !${NC}"
26+
echo ""
27+
else
28+
echo -e "${RED}$PRIVKEY doesn't exist !${NC}"
29+
exit
30+
fi
31+
32+
#CONCATENATING (Yes, that simple...but safe !)
33+
cat $CERT $PRIVKEY > $OUTPUT
34+
35+
if test -f "$OUTPUT";
36+
then
37+
echo -e "${GREEN}$OUTPUT OK !${NC}"
38+
exit
39+
else
40+
echo -e "${RED}Output to $OUTPUT error !${NC} (permission problem ?)"
41+
exit
42+
fi

0 commit comments

Comments
 (0)