store drideOS startup script locally and replace drideOSZ startup file

This commit is contained in:
Yossi 2017-06-16 08:54:57 +03:00
parent 748ec17bfa
commit 3c09c4c10e
5 changed files with 144 additions and 10 deletions

View File

@ -193,30 +193,31 @@ sudo update-rc.d isc-dhcp-server enable
sudo wget https://dride.io/code/startup/dride-ws
sudo wget https://dride.io/code/startup/dride-core
sudo wget https://dride.io/code/startup/drideOS-resize
#startup script's #startup script's
# express on startup # express on startup
sudo cp dride-ws /etc/init.d/dride-ws sudo cp files/dride-ws /etc/init.d/dride-ws
sudo chmod +x /etc/init.d/dride-ws sudo chmod +x /etc/init.d/dride-ws
sudo update-rc.d dride-ws defaults sudo update-rc.d dride-ws defaults
sudo rm dride-ws
# dride-core on startup # dride-core on startup
sudo cp dride-core /etc/init.d/dride-core if [ ${OS_TYPE} == "drideOS" ]; then
sudo cp files/dride-core /etc/init.d/dride-core
else
sudo cp files/dride-core-z /etc/init.d/dride-core
fi;
sudo chmod +x /etc/init.d/dride-core sudo chmod +x /etc/init.d/dride-core
sudo update-rc.d dride-core defaults sudo update-rc.d dride-core defaults
sudo rm dride-core
if [ ${OS_TYPE} == "drideOS" ]; then if [ ${OS_TYPE} == "drideOS" ]; then
# drideOS-resize on startup # drideOS-resize on startup
sudo cp drideOS-resize /etc/init.d/drideOS-resize sudo cp files/drideOS-resize /etc/init.d/drideOS-resize
sudo chmod +x /etc/init.d/drideOS-resize sudo chmod +x /etc/init.d/drideOS-resize
sudo update-rc.d drideOS-resize defaults sudo update-rc.d drideOS-resize defaults
sudo rm drideOS-resize
fi fi

View File

@ -0,0 +1,42 @@
#! /bin/sh
# /etc/init.d/dride-core
### BEGIN INIT INFO
# Provides: dride-core
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: will run the main dride-core process
# Description:
### END INIT INFO
case "$1" in
start)
echo "Starting dride-core"
# run application you want to start
sudo python /home/Cardigan/mainPi.py &
# run gps daemon
sudo python /home/Cardigan/daemons/gps/helper.py &
# run button / bluetooth daemon
sudo python /home/Cardigan/daemons/bluetooth/initPin.py &
sleep 5 && sudo BLENO_DEVICE_NAME="dride" node /home/Cardigan/daemons/bluetooth/main.js &
;;
stop)
echo "Stopping dride-core"
# kill application you want to stop
killall python
;;
*)
echo "Usage: /etc/init.d/dride-core{start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,42 @@
#! /bin/sh
# /etc/init.d/dride-core
### BEGIN INIT INFO
# Provides: dride-core
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: will run the main dride-core process
# Description:
### END INIT INFO
case "$1" in
start)
echo "Starting dride-core"
# run application you want to start
sudo python /home/Cardigan/mainPiZero.py &
# run gps daemon
sudo python /home/Cardigan/daemons/gps/helper.py &
# run button / bluetooth daemon
sudo python /home/Cardigan/daemons/bluetooth/initPin.py &
sleep 5 && sudo BLENO_DEVICE_NAME="dride" node /home/Cardigan/daemons/bluetooth/main.js &
;;
stop)
echo "Stopping dride-core"
# kill application you want to stop
killall python
;;
*)
echo "Usage: /etc/init.d/dride-core{start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,31 @@
#! /bin/sh
# /etc/init.d/dride-ws
### BEGIN INIT INFO
# Provides: dride-ws
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: will run the dride web server on startup
# Description: AKA dride-ws
### END INIT INFO
case "$1" in
start)
echo "Starting dride-ws"
# run node-express server
sudo node /home/Cardigan/dride-ws/server/app.js &
;;
stop)
echo "Stopping dride-ws"
# kill application you want to stop
killall node
;;
*)
echo "Usage: /etc/init.d/dride-ws{start|stop}"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,18 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: drideOS-resize
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: will resize the file system & reboot
# Description:
### END INIT INFO
echo "dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait" > /boot/cmdline.txt
# Delete the script
rm $0
# reboot
sudo reboot