Skip to content

Instantly share code, notes, and snippets.

@vrdominguez vrdominguez/dinaip
Created Aug 13, 2014

Embed
What would you like to do?
Versión para OpenWRT del script init.d para poner dinaIP como servicio
#!/bin/sh /etc/rc.common
# dinaIP Service for OpenWRT
# Author: Victor Rodriguez
# Date: 2014-08-13
START=70;
STOP=15;
# Comandos personalizados
EXTRA_COMMANDS="status list"
# Ayuda personalizada
EXTRA_HELP=" status Get daemon status
list Get available domains"
USERNAME="usuario_panel_dinahosting"
PASSWORD="clave_panel_dinahosting"
start() {
# Iniciando dinaIP
/usr/sbin/dinaip -u $USERNAME -p $PASSWORD
}
stop() {
# Deteniendo dinaIP
/usr/sbin/dinaip -d
}
restart() {
/usr/sbin/dinaip -d
/usr/sbin/dinaip -u $USERNAME -p $PASSWORD
}
status() {
/usr/sbin/dinaip -s
# Exit status: 0 - running, 1 - stopped
if [ -f /var/run/dinaip.pid ]; then
kill -0 `cat /var/run/dinaip.pid`
if [ "$?" == "0" ]; then
exit 0
else
exit 1
fi
else
exit 1
fi
}
list() {
/usr/sbin/dinaip -u $USERNAME -p $PASSWORD -l
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.