ugnen

git clone https://git.tarina.org/ugnen
Log | Files | Refs

install.sh (806B)


      1 #!/bin/bash
      2 
      3 echo "run with sudo ./install.sh"
      4 
      5 installfolder=" $(pwd)"
      6 echo "$installfolder"
      7 
      8 cat <<EOF > /etc/systemd/system/remoteconnect.service
      9 [Unit]
     10 Description=remoteconnect
     11 After=multi-user.target
     12 
     13 [Service]
     14 Type=simple
     15 ExecStart=$installfolder/remoteconnect.sh
     16 User=pi
     17 Restart=always
     18 RestartSec=3
     19 StandardInput=tty-force
     20 TTYPath=/dev/tty3
     21 
     22 [Install]
     23 WantedBy=multi-user.target
     24 EOF
     25 cat <<EOF > /etc/systemd/system/ugnen.service
     26 [Unit]
     27 Description=ugnen
     28 After=multi-user.target
     29 
     30 [Service]
     31 Type=simple
     32 ExecStart=/usr/bin/python3 $installfolder/ugnen.py
     33 User=pi
     34 Restart=always
     35 RestartSec=3
     36 StandardInput=tty-force
     37 TTYPath=/dev/tty1
     38 
     39 [Install]
     40 WantedBy=multi-user.target
     41 EOF
     42 systemctl enable ugnen
     43 systemctl enable remoteconnect
     44 systemctl daemon-reload
     45 
     46 usermod -a -G dialout pi
     47 usermod -a -G tty pi
     48