Skip to content

Instantly share code, notes, and snippets.

@vgezer
Last active February 15, 2016 11:20
Show Gist options
  • Save vgezer/95db85752eb93bb9a922 to your computer and use it in GitHub Desktop.
Save vgezer/95db85752eb93bb9a922 to your computer and use it in GitHub Desktop.
PageKite service script for Raspberry Pi or Banana Pi models

Replace user with your username and save the file to the location /etc/init.d/ with the name pagekite and give execute permissions on the file chmod +x pagekite

Then execute:


# update-rc.d pagekite defaults

From now on, you can call:

# service pagekite start
# service pagekite stop
# service pagekite restart

to start, stop, and restart the service respectively.

#!/bin/sh
### BEGIN INIT INFO
# Provides: pagekite
# Required-Start: $remote_fs $syslog $named
# Required-Stop: $remote_fs $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: PageKite service script
# Description: PageKite script to start at boot automatically
# Author: Volkan Gezer
# Version: 1.2
### END INIT INFO
USER=root
export USER
case "$1" in
start)
echo "Starting pagekite"
su $USER -c "pagekite.py --logfile=/var/log/pagekite.log > /dev/null 2>&1 &"
;;
stop)
echo "Stopping pagekite"
kill `pgrep pagekite`
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment