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

Lengkap Disiarkan 3 tahun lepas Dibayar semasa penghantaran
Lengkap Dibayar semasa penghantaran

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 Memasang Skrip

ID Projek: #29401807

Tentang projek

3 cadangan Projek jarak jauh Aktif 3 tahun lepas

Dianugerahkan kepada:

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 dalam 2 hari
(1 Ulasan)
1.6

3 pekerja bebas membida secara purata $27 untuk pekerjaan ini

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 dalam sehari
(16 Ulasan)
3.6