Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################### Ruby Script #########################
- require 'fcntl'
- begin
- fd = IO.sysopen('/dev/ttyUSB0', Fcntl::O_RDWR)
- sleep 0.01 while true
- rescue SignalException
- File.open('/tmp/x'.freeze, 'a').puts($!.full_message)
- sleep 0.01
- puts 'hi'
- retry
- rescue Exception
- retry
- end
- ######################### Systemd Service #########################
- [Unit]
- Description=Arduino OLED as a Ultra Light-Weight System Monitor
- [Service]
- # ExecStart=/bin/ruby /root/.local/share/gem/ruby/3.0.0/bin/blink-tm
- ExecStart=/bin/ruby /tmp/p.rb
- Type=simple
- Restart=on-failure
- User=root
- Group=root
- [Install]
- WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement