Skip to content

Instantly share code, notes, and snippets.

@haiderfaraz
Last active August 20, 2016 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haiderfaraz/3163e05a6c27e1ffebfbb099a5e4555e to your computer and use it in GitHub Desktop.
Save haiderfaraz/3163e05a6c27e1ffebfbb099a5e4555e to your computer and use it in GitHub Desktop.
Bitnami Moodle init script
#!/bin/bash
# Moodle Startup Service script v1.0 by Faraz Haider 19 August 2016
# acts as startup service script for Learning Management System.
# USAGE: start|stop|status
#
case "$1" in
start)
echo "Starting Moodle."
su -c '/opt/moodle/ctlscript.sh start' user_name
;;
stop)
echo "Stopping Moodle."
su -c '/opt/moodle/ctlscript.sh stop' user_name
;;
status)
# Check to see if the process is running
su -c '/opt/moodle/ctlscript.sh status' user_name
;;
*)
echo "Moodle Service."
echo $"Usage: $0 {start|stop|status}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment