[no ci] rubyfpv: adjust init.d script (#1342)

pull/1343/head
viktorxda 2024-03-10 19:51:20 +01:00 committed by GitHub
parent 29e6d8a3d0
commit 4410246b4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 26 deletions

View File

@ -1,31 +1,26 @@
#!/bin/sh
#
# Start ruby
#
chip=$(ipcinfo -c)
hw=$(ipcinfo -c)
fw=$(grep "BUILD_OPTION" "/etc/os-release" | cut -d= -f2)
echo "Chip: " > /tmp/ruby_boot.log
echo ${chip} >> /tmp/ruby_boot.log
echo "Firmware: " >> /tmp/ruby_boot.log
echo ${fw} >> /tmp/ruby_boot.log
echo "Chipset = ${hw}" | logger -s -t RubyFPV
echo "Firmware = ${fw}" | logger -s -t RubyFPV
case "$1" in
start)
if ! [ -f /etc/system.ok ]; then
tweaksys ${chip}
fi
start)
if ! [ -f /etc/system.ok ]; then
tweaksys ${hw}
fi
echo "Starting Ruby..." | logger -s -t RubyFPV
ruby_start
;;
echo "Starting Ruby..."
echo "Starting Ruby..." >> /tmp/ruby_boot.log
/usr/sbin/ruby_start
;;
stop)
echo "Stopping Ruby..."
echo "Stopping Ruby..." >> /tmp/ruby_boot.log
/usr/sbin/ruby_stop.sh
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
stop)
echo "Stopping Ruby..." | logger -s -t RubyFPV
ruby_stop
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac

View File

@ -1,3 +1,4 @@
#!/bin/sh
killall -q ruby_start
killall -q ruby_rx_commands
killall -q ruby_tx_telemetry

View File

@ -23,7 +23,7 @@ define RUBYFPV_INSTALL_TARGET_CMDS
$(INSTALL) -m 755 -d $(TARGET_DIR)/usr/sbin
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(@D)/output/*
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/ruby_stop.sh
$(INSTALL) -m 755 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/ruby_stop
$(INSTALL) -m 644 -t $(TARGET_DIR)/usr/sbin $(RUBYFPV_PKGDIR)/files/version_ruby_base.txt
endef