install.sh (531B)
1 #!/bin/bash 2 3 echo "run with sudo ./install.sh" 4 5 installfolder="$(pwd)" 6 echo "$installfolder" 7 user="$(whoami)" 8 echo "$user" 9 10 systemctl disable ride_on 11 systemctl daemon-reload 12 13 cat <<EOF > /etc/systemd/system/ride_on.service 14 [Unit] 15 Description=ride_on 16 After=multi-user.target 17 18 [Service] 19 Type=simple 20 ExecStart=/usr/bin/python3 $installfolder/ride_on.py 21 User=$user 22 Restart=always 23 RestartSec=3 24 StandardInput=tty-force 25 26 [Install] 27 WantedBy=multi-user.target 28 EOF 29 systemctl enable ride_on 30 systemctl daemon-reload 31 32 systemctl restart ride_on