13-06-2018, 07:27 AM
Hola
Prueba con el siguiente contenido
———
#!/bin/sh
CONF=/etc/config/qpkg.conf
QPKG_NAME="autoarranque"
QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}`
APACHE_ROOT=`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info`
export QNAP_QPKG=$QPKG_NAME
case "$1" in
start)
ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
if [ "$ENABLED" != "TRUE" ]; then
echo "$QPKG_NAME esta deshabilitado."
exit 1
fi
: ADD START ACTIONS HERE
#agrego tareas a iniciar
/share/CACHEDEV1_DATA/.qpkg/PlexDrive/plexdrive mount -c /share/CACHEDEV1_DATA/plexdrive/.plexdrive -o allow_other /share/CACHEDEV1_DATA/homes/admin/Plexcloud -v 3 --cache-file=/share/CACHEDEV1_DATA/plexdrive/cache.bolt
;;
stop)
: ADD STOP ACTIONS HERE
/share/CACHEDEV1_DATA/.qpkg/PlexDrive/plexdrive umount -c /share/CACHEDEV1_DATA/plexdrive/.plexdrive -o allow_other /share/CACHEDEV1_DATA/homes/admin/Plexcloud -v 3 --cache-file=/share/CACHEDEV1_DATA/plexdrive/cache.bolt
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
———
Al activar el qpkg ficticio debería ejecutar tu línea, y al desactivar el qpkg desde el app center debería desmontar (umount).
Creo que es más sencillo y por limpieza, el que tengas dos archivos .sh que serían los llamados desde el qpkg.
Por ejemplo te creas:
• un /share/CACHEDEV1_DATA/misscripts/plexon.sh con el contenido que ejecute tu línea.
• un /share/CACHEDEV1_DATA/misscripts/plexoff.sh con el contenido que deshaga la acción de tu línea.
De esta forma en las líneas del autoarranque te quedan más sencillas, claras, manejable y puedes usarlo para activar o desactivar más cosas.
Un saludo
Agur eta ondo ibili
Prueba con el siguiente contenido
———
#!/bin/sh
CONF=/etc/config/qpkg.conf
QPKG_NAME="autoarranque"
QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f ${CONF}`
APACHE_ROOT=`/sbin/getcfg SHARE_DEF defWeb -d Qweb -f /etc/config/def_share.info`
export QNAP_QPKG=$QPKG_NAME
case "$1" in
start)
ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
if [ "$ENABLED" != "TRUE" ]; then
echo "$QPKG_NAME esta deshabilitado."
exit 1
fi
: ADD START ACTIONS HERE
#agrego tareas a iniciar
/share/CACHEDEV1_DATA/.qpkg/PlexDrive/plexdrive mount -c /share/CACHEDEV1_DATA/plexdrive/.plexdrive -o allow_other /share/CACHEDEV1_DATA/homes/admin/Plexcloud -v 3 --cache-file=/share/CACHEDEV1_DATA/plexdrive/cache.bolt
;;
stop)
: ADD STOP ACTIONS HERE
/share/CACHEDEV1_DATA/.qpkg/PlexDrive/plexdrive umount -c /share/CACHEDEV1_DATA/plexdrive/.plexdrive -o allow_other /share/CACHEDEV1_DATA/homes/admin/Plexcloud -v 3 --cache-file=/share/CACHEDEV1_DATA/plexdrive/cache.bolt
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
———
Al activar el qpkg ficticio debería ejecutar tu línea, y al desactivar el qpkg desde el app center debería desmontar (umount).
Creo que es más sencillo y por limpieza, el que tengas dos archivos .sh que serían los llamados desde el qpkg.
Por ejemplo te creas:
• un /share/CACHEDEV1_DATA/misscripts/plexon.sh con el contenido que ejecute tu línea.
• un /share/CACHEDEV1_DATA/misscripts/plexoff.sh con el contenido que deshaga la acción de tu línea.
De esta forma en las líneas del autoarranque te quedan más sencillas, claras, manejable y puedes usarlo para activar o desactivar más cosas.
Un saludo
Agur eta ondo ibili
Un saludo
Agur eta ondo ibili
Ganekogorta (TS-469Pro, TVS-673e, QBoat Sunny, TS-453Be, TR-002 y QHora-301w) Ʀɐɯ0η
Agur eta ondo ibili
Ganekogorta (TS-469Pro, TVS-673e, QBoat Sunny, TS-453Be, TR-002 y QHora-301w) Ʀɐɯ0η