Skip to content

Instantly share code, notes, and snippets.

@auyongcheemeng
Created October 1, 2016 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save auyongcheemeng/d38ea6da2bfb5d53e8657853d05ffbd8 to your computer and use it in GitHub Desktop.
Save auyongcheemeng/d38ea6da2bfb5d53e8657853d05ffbd8 to your computer and use it in GitHub Desktop.
#!/bin/sh
# This script automates the setup ssl cert and key on Tomato router to use JFFS
# Based on Tutorial: Use SSL certificate for WAN admin @http://tomatousb.org/tut:use-ssl-certificate-for-wan-admin
# Requires default `certpem` and `key.pem` present at /jffs/ssl/
rm /etc/cert.pem
rm /etc/key.pem
ln -s /jffs/ssl/cert.pem /etc/cert.pem
ln -s /jffs/ssl/key.pem /etc/key.pem
tar -C / -czf /tmp/cert.tgz etc/cert.pem etc/key.pem
nvram setfb64 https_crt_file /tmp/cert.tgz
nvram commit
service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment