Завершен

Bash / Shell Script: correct / debug Shell script to wake up screen at 7am, launch Chromium, and sleep screen at 7pm

Hi,

I have a few Shell scripts, I want to run automatically on a Raspberry Pi,

Here is how it goes:

1. The Crontab part should launch the [login to view URL] script and schedule [login to view URL] at 7am, and [login to view URL] at 7pm

2. [login to view URL] should launch [login to view URL] if a reboot happens between 7am and 7pm; BUT if the reboot happens 7pm and 7am (the opposite),... then it should run [login to view URL]

3. [login to view URL] should wake up screen, launch chromium-browser... launch [login to view URL] script, etc. See below

4. [login to view URL] (see below)

WHAT TO DO: this is not working and I have no time to debug / correct, if you can do it, please let me know. Please also test it on your side, if it works then your job is done.

CRONTAB:

@reboot sleep 30 && /home/pi/Desktop/[login to view URL]

0 7 * * * DISPLAY=:0 /home/pi/Desktop/[login to view URL]

0 19 * * * DISPLAY=:0 /home/pi/Desktop/[login to view URL]

THE [login to view URL] FILE

//-----------//

export DISPLAY=:0

# if 7 > time < 19, run [login to view URL]

currenttime=$(date +%H:%M)

if [[ "$currenttime" > "07:00" ]] && [[ "$currenttime" < "19:00" ]]; then

do

sleep 15 && /home/pi/Desktop/[login to view URL]

else

do

sleep 15 && /home/pi/Desktop/[login to view URL]

fi

done

//-----------//

THE [login to view URL] FILE

//-----------//

export DISPLAY=:0

# finish evening

pkill -f evening

# wake up screen at 7am, sleep at 7pm

xset dpms force on

sleep 5 && chromium-browser --kiosk --disable-restore-session-state "https://analytics.google.com/analytics/web/#/report/trafficsources-all-traffic/a26460474w51176098p51852097/_u.dateOption=last30days&_.goalOption=6"

# tab switching with xdotool

pkill -f keystrokes

sleep 60 && /home/pi/Desktop/[login to view URL]

# set xset prefs every 5mins (so it never fails)

while (true)

do

xset dpms 0 0 0

xset s 0 0

sleep 300

done

//-----------//

THE [login to view URL] FILE

//-----------//

export DISPLAY=:0

# finish morning process

pkill -f morning

# stop keystrokes

pkill -f keystrokes

# close chromium

pkill -f chromium

# set screen auto-sleep: 10min

xset dpms 600 600 600

xset s 600 600

# sleep screen pm

xset dpms force off

//-----------//

THE [login to view URL] FILE

//-----------//

export DISPLAY=:0

while (true)

do

xdotool keydown ctrl+Tab; xdotool keyup ctrl+Tab

sleep 60

done

//-----------//

Навыки: Shell Script, Linux, Ubuntu, Установка скриптов

Показать больше: ocs 2007 debug script, bash mail log file script, bash insert mysql table script, bash script file organization script, linux bash find broken links script, debug script automator, bash script kill process script, python / ffmpeg ( debug script and webservice integration), python ffmpeg debug script and webservice integration, run a python script in debug mode, wordpress debug script, bash import function from script, how to run the python script in debug mode, home assistant debug script, run powershell script in debug mode, bash script running python script, photoshop debug script, how to run python script in debug mode in unix, unable to debug script task in ssis

О работодателе:
( 2 отзыв(-а, -ов) ) Strasbourg, Morocco

ID проекта: #29401807

Поручен:

josefmoravek

Hello sir, I am more than 25 year linux admin. I will correct, test this script. I will add log or mail service on errors, if you use it. Josef

$15 USD за 2 дней(-я)
(1 отзыв)
1.6

3 фрилансеров(-а) готовы выполнить эту работу в среднем за $27

(352 отзывов(-а))
7.1
elyess150

Hello ! Im experienced sysadmin with almost 3 years of experience i can get this done exactly as needed. If you are interested please feel free to contact me. Thank you ! Best regards,

$35 USD за 1 день
(16 отзывов(-а))
3.6