Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Changed logic for setting privkey and fullchain
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Mar 11, 2018
1 parent de307b7 commit 8c697f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions package/opt/hassbian/suites/files/webterminalsslhelper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ elif [ -d "/home/homeassistant/dehydrated/certs" ]; then
else
CERTDIR=""
fi
FULLCHAIN=$(find "$CERTDIR" -type f | grep fullchain)
PRIVKEY=$(find "$CERTDIR" -type f | grep privkey)
DOMAIN=$(ls "$CERTDIR")
cat "$FULLCHAIN" "$PRIVKEY" > /var/lib/shellinabox/certificate-"$DOMAIN".pem
cat "$CERTDIR$DOMAIN/fullchain.pem" "$CERTDIR$DOMAIN/privkey.pem" > /var/lib/shellinabox/certificate-"$DOMAIN".pem
chown shellinabox:shellinabox -R /var/lib/shellinabox/
service shellinabox restart
exit 0
8 changes: 2 additions & 6 deletions package/opt/hassbian/suites/webterminal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@ if [ "$SSL" == "y" ] || [ "$SSL" == "Y" ]; then
else
CERTDIR=""
fi
echo "Setting cert fullchain location..."
FULLCHAIN=$(find "$CERTDIR" -type f | grep fullchain)
echo "Setting cert privkey location..."
PRIVKEY=$(find "$CERTDIR" -type f | grep privkey)
DOMAIN=$(ls "$CERTDIR")
echo "Merging files and adding to correct dir..."
cat "$FULLCHAIN" "$PRIVKEY" > /var/lib/shellinabox/certificate-"$DOMAIN".pem
DOMAIN=$(ls "$CERTDIR")
cat "$CERTDIR$DOMAIN/fullchain.pem" "$CERTDIR$DOMAIN/privkey.pem" > /var/lib/shellinabox/certificate-"$DOMAIN".pem
chown shellinabox:shellinabox -R /var/lib/shellinabox/
echo "Adding crong job to copy certs..."
(crontab -l ; echo "5 1 1 * * bash /opt/hassbian/suites/files/webterminalsslhelper.sh >/dev/null 2>&1")| crontab -
Expand Down

0 comments on commit 8c697f7

Please sign in to comment.