Find the answer to your Linux question:
Results 1 to 4 of 4
Hi Guys, I'm running Fedora core 6 and have iinstalled WINE to run a weather program. The program collects data from a weather station connected to serial com port 1. ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    2

    bash script for com port 1

    Hi Guys,

    I'm running Fedora core 6 and have iinstalled WINE to run a weather program. The program collects data from a weather station connected to serial com port 1. In order to get the program to "speak" to the com port I currently have to open the terminal window, log in as su and then chmod 777 /dev/ttyS0. I would like to be able to write a script that will run when linux starts to a) carry out the above chmod to the com port, and b) start wine and the program I need running at the same time. I am sure this is fairly easily done but have no idea where to start.

    Any clues would be appreciated!!

    Andy

  2. #2
    Just Joined! cfajohnson's Avatar
    Join Date
    May 2007
    Location
    Toronto, Canada
    Posts
    52
    Quote Originally Posted by andybt View Post
    Hi Guys,

    I'm running Fedora core 6 and have iinstalled WINE to run a weather program. The program collects data from a weather station connected to serial com port 1. In order to get the program to "speak" to the com port I currently have to open the terminal window, log in as su and then chmod 777 /dev/ttyS0.

    Use sudo rather than su. Set up a line in /etc/sudoers (using visudo) to allow you to execute the command, then:

    Code:
    sudo chmod 777 /dev/tty/S0
    (Though you should set things up so you can get by with less than 777, probably 774 would work.)
    I would like to be able to write a script that will run when linux starts to a) carry out the above chmod to the com port, and b) start wine and the program I need running at the same time. I am sure this is fairly easily done but have no idea where to start.

    Have you read the wine man page?

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    2
    Thanks for that I'll give it a go.

    Haven't had time to read the Wine FAQ's yet as I was more concerned with getting the com port working on each reboot. As I said I'm sure it's easy to do.

    Andy

  4. #4
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    welcome to the forum

    > a) carry out the above chmod to the com port

    put "chmod 777 /dev/ttyS0" in /etc/rc.local: it will be
    executed on bootup

    > b) start wine and the program I need running at the same time

    well, look at "man wine" see if there'e an option "-e"
    or something, that let's you start wine with your
    program already loaded

    exec wine -e program
    the sun is new every day (heraclitus)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...