Skip to content

Instantly share code, notes, and snippets.

@laemmy
Created March 3, 2019 16:04
Show Gist options
  • Save laemmy/a6eb6f78c86b4ef737f9308f6877239e to your computer and use it in GitHub Desktop.
Save laemmy/a6eb6f78c86b4ef737f9308f6877239e to your computer and use it in GitHub Desktop.
#! /bin/bash
### BEGIN INIT INFO
# Provides: MMDVM Hotspot
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: MMDVM Hotspot service
# Description: MMDVM Hotspot service
### END INIT INFO
case "$1" in
start)
echo "Starting Hotspot..."
sudo -u pi bash -c '/opt/hotspot/MMDVMHost/MMDVMHost /opt/hotspot/MMDVMHost/MMDVM.ini'
sudo -u pi bash -c '/opt/hotspot/DMRGateway/DMRGateway /opt/hotspot/DMRGateway/DMRGateway.ini'
;;
stop)
echo "Stopping Hotspot..."
sudo -u root bash -c 'killall MMDVMHost'
sudo -u root bash -c 'killall DMRGateway'
sleep 2
;;
*)
echo "Usage: /etc/init.d/hotspot {start|stop}"
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment