Wednesday, May 15, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1396  / 1 Year ago, sun, may 21, 2023, 4:53:50

I have been trying to launch a script of mine at start-up using both rc.local and crontab methods but neither are working



Here is my script contents:



#!/bin/bash
sudo hue spectrum 2
exit 0


Here is my crontab contents (minus the comments):



@reboot /home/ben/Documents/startup_scripts/hue+.sh


EDIT:
I tried using the echo command to simulate me typing in my pass word in one line but alas, that did not work either.
Here is that version of the script:



#!/bin/bash
echo <mypassword> | sudo -S hue spectrum 2
exit 0


EDIT 2:
I do use the sudo crontab file and the hue command starts an open source version of NZXT's CAM software that lets me control NZXT devices in my computer (cooler, fans, LEDs, etc) also here is the "hue.log" file for those who have asked for it



/home/ben/Documents/startup_scripts/hue+.sh: line 2: hue: command not found


I don't know hwy it says command not found this command 100% works with sudo



EDIT 3:
I added myself to the group "dialout" and now the command works without sudo, unfortunately the log file is identical to what it was before and the script still does not work on startup



/home/ben/Documents/startup_scripts/hue+.sh: line 2: hue: command not found

More From » usb

 Answers
3

This solution may be very situational to me, but i added a sleep command to my crontab file to give the computer more time, and it miraculously worked no reason it shouldn't have worked without the sleep command but it seems to have foxed the issue


[#7634] Sunday, May 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jokaned

Total Points: 315
Total Questions: 116
Total Answers: 119

Location: Somalia
Member since Mon, Feb 27, 2023
1 Year ago
;