-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathraspberrychromiumautostart
110 lines (77 loc) · 1.71 KB
/
raspberrychromiumautostart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
#Directory of the main script
script=/bin/chromium-autostart
#Directory of the main script backup
scriptbackup=/bin/chromium-autostart.tmp
#Directory of autostart of Raspberry
lxdepi=/home/pi/.config/lxsession/LXDE-pi/autostart
#Directory of autostart of Raspberry backup
lxdepibackup=/home/pi/.config/lxsession/LXDE-pi/autostart.tmp
clear
cat hexa
sleep 5s
clear
echo "Paste the full URL that you want to Chromium auto open. Example: http://hexanetworks.com.br"
sleep 1s
read dashboard
if [ -f "$script" ]
then
cat $script
echo
read -p "The file $script already exists, delete? (Y/N)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
#CHECK IF BACKUP EXIST
if [ -f "$scriptbackup" ]
then
rm $scriptbackup
fi
mv $script $scriptbackup
echo "File moved to $scriptbackup"
echo "chromium-browser --noerordialogs --disable-session-crashed-bubble --start-fullscreen --app=$dashboard" > $script
chmod a+x $script
else
echo "EXITING SCRIPT..."
exit
fi
else
echo "chromium-browser --noerordialogs --disable-session-crashed-bubble --start-fullscreen --app=$dashboard" > $script
chmod a+x $script
fi
if [ -f "$lxdepi" ]
then
cat $lxdepi
echo
read -p "The file $lxdepi already exists, delete? (Y/N)" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
if [ -f "$lxdepibackup" ]
then
rm $lxdepibackup
fi
mv $lxdepi $lxdepibackup
echo "File moved to $lxdepibackup"
else
exit
fi
else
echo "@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@point-rpi
chromium-autostart" > $lxdepi
chmod a+x $lxdepi
fi
echo "======
$script
======"
more $script
sleep 1s
echo "======
$lxdepi
======"
more $lxdepi
sleep 2s
cat hexa