Merge branch 'patch-5' into 'dev'
Start Shinobi via cronjob in more logical way (OpenBSD) See merge request Shinobi-Systems/Shinobi!153revert-b25c0d81
commit
24057e3da3
|
@ -16,10 +16,6 @@
|
|||
|
||||
# Functions
|
||||
|
||||
random_string () {
|
||||
head -n 100 < /dev/urandom | sha256
|
||||
}
|
||||
|
||||
doas_perms_abort () {
|
||||
echo "\n!!! doas is not enabled! Please check /etc/doas.conf configuration. Exiting..." ; exit 1
|
||||
}
|
||||
|
@ -114,9 +110,6 @@ dev_download () {
|
|||
doas -u _shinobi ftp -o /home/_shinobi/shinobi.tar.gz https://gitlab.com/Shinobi-Systems/Shinobi/-/archive/dev/Shinobi-dev.tar.gz
|
||||
}
|
||||
|
||||
# Constants
|
||||
tmp=$(random_string)
|
||||
|
||||
# Script Start
|
||||
|
||||
while true ; do
|
||||
|
@ -199,14 +192,6 @@ doas -u _shinobi cp /home/_shinobi/shinobi/conf.sample.json /home/_shinobi/shino
|
|||
doas -u _shinobi cp /home/_shinobi/shinobi/super.sample.json /home/_shinobi/shinobi/super.json
|
||||
doas npm install -g pm2
|
||||
|
||||
# Create script to be run by cron to start Shinobi as boot
|
||||
|
||||
echo "#!/bin/sh
|
||||
cd /home/_shinobi/shinobi
|
||||
pm2 start camera.js cron.js" > /tmp/"$tmp"
|
||||
|
||||
doas -u _shinobi cp /tmp/"$tmp" /home/_shinobi/shinobi/OpenBSD-cron.sh && rm /tmp/"$tmp"
|
||||
|
||||
# Post-Install Info
|
||||
echo "\nCongratulations, Shinobi is now installed!\n"
|
||||
|
||||
|
@ -214,7 +199,7 @@ echo 'To start Shinobi at boot, add a crontab entry for the user "_shinobi" with
|
|||
|
||||
echo '$ doas crontab -u _shinobi -e
|
||||
|
||||
@reboot /bin/sh /home/_shinobi/shinobi/OpenBSD-cron.sh'
|
||||
@reboot /bin/sh -c "cd /home/_shinobi/Shinobi && pm2 start camera.js cron.js"
|
||||
|
||||
echo "\nYou can access Shinobi at http://$(ifconfig | grep 'inet ' | awk '!/127.0.0.1/ {print $2}'):8080"
|
||||
|
||||
|
|
Loading…
Reference in New Issue