/
Generate certificates using bash scripting

Generate certificates using bash scripting

(warning)This page is out of date

This page is out of date. For the latest instructions, see the edX documentation.


This how-to explain how to use bash scripting to generate certificates.

Step-by-step guide.

You will run bash script to produce certificate.

  1. Run the command in your open edX instance.

    $ wget https://raw.githubusercontent.com/ariestiyansyah/OpenX/master/certificate-generate.sh
  2. Run the command below.

    $ bash certificate-generate.sh
  3. Code will give an output to insert course id, enter course id you want to generate, for example edX/edX101/2016_Run1
  4. Select Y to generate certificate and N to cancel.
  5. Done.


This is the source code explanation of the steps:

#!/bin/bash
# change directory to edx-platform
cd /edx/app/edxapp/edx-platform

# prompt user, and read command line argument
read -p 'Enter course ID: ' idcourse
read -p "edXius, Are you sure you want to generate the certificate (Y/N)? " answer

# handle the command line argument we were given
while true
do
  case $answer in
   [yY]* ) echo "Okay Darth edXius, Start generating $idcourse "
           sudo -u www-data /edx/bin/python.edxapp ./manage.py lms --settings production ungenerated_certs -c $idcourse --insecure
           break;;

   [nN]* ) exit;;

   * )     echo "edXius, just enter Y or N, please."; break ;;
  esac
done


Rizky.

Related content

Managing Open edX Tips and Tricks
Managing Open edX Tips and Tricks
More like this
How to Enable On-Demand Certificate Download for Self-Paced Courses
How to Enable On-Demand Certificate Download for Self-Paced Courses
More like this
Creating and Updating Databases and Database Users
Creating and Updating Databases and Database Users
Read with this
Local setup
More like this
How to add a django Configuration Setting
How to add a django Configuration Setting
Read with this
Certificates
More like this