-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathautoinstaller.sh
56 lines (48 loc) · 2.47 KB
/
autoinstaller.sh
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
#!/bin/bash
if [ "${UID}" != "0" ]; then
echo "You must be root to start the installation"
exit 1
fi
echo "Starting Process"
echo "Updating Repositories"
apt update -y && apt upgrade -y
wait
echo "Installing necessary packages"
apt install unclutter ffmpeg libmariadb3 libpq5 libmicrohttpd12 -y
echo "Installing MotionEye "
wget https://github.com/Motion-Project/motion/releases/download/release-4.5.1/pi_buster_motion_4.5.1-1_armhf.deb
apt install pi_buster_motion_4.5.1-1_armhf.deb
systemctl stop motion && systemctl disable motion
apt install python2 python-dev-is-python2 -y
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
python2 get-pip.py
apt install libssl-dev libcurl4-openssl-dev libjpeg-dev zlib1g-dev -y
pip2 install motioneye
mkdir -p /etc/motioneye
cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
mkdir -p /var/lib/motioneye
cp /usr/local/share/motioneye/extra/motioneye.systemd-unit-local /etc/systemd/system/motioneye.service
systemctl daemon-reload
systemctl enable motioneye
systemctl start motioneye
echo "Backuping config.txt"
cp /boot/config.txt /boot/config.txt.bak
echo "Modifying config.txt"
sed -i 's/dtoverlay=vc4-kms-v3d/dtoverlay=vc4-fkms-v3d/' //boot/config.txt
sed -i 's/arm_boost=1/# arm_boost=1/' //boot/config.txt
sh -c 'echo "over_voltage=6" >> //boot/config.txt'
sh -c 'echo "arm_freq=2100" >> //boot/config.txt'
sh -c 'echo "gpu_freq=750" >> //boot/config.txt'
sh -c 'echo "gpu_mem=256" >> //boot/config.txt'
echo "Backuping autostart config file"
cp /etc/xdg/lxsession/LXDE-pi/autostart /etc/xdg/lxsession/LXDE-pi/autostart.bak
echo "Modifying autostart config file"
sh -c 'echo "@xset s noblank" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@xset s off" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@xset -dpms" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@unclutter -idle 0.5 -root &" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@chromium-browser --noerrdialogs --disable-infobars --kiosk https://www.ya.ru &" >> //etc/xdg/lxsession/LXDE-pi/autostart'
sh -c 'echo "@python3 /home/vova/PIR-Sensor/pir.py &" >> //etc/xdg/lxsession/LXDE-pi/autostart'
echo "Done"