Announcement

Collapse
No announcement yet.

autostart bash script problem

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    autostart bash script problem

    I am trying to get a bash script to autostart. It is saved as .sh and located in the ./.kde/autostart folder. Instead of actually running the script, it opens it in Kate on start up. I tried checking the run in terminal and all it does is open the terminal with a normal prompt.

    #2
    Re: autostart bash script problem

    Assuming you already made it executable with "chmod a+x myscript", and assuming you are running KDE4, then you need to open System Settings, and there's an "Autostart" icon on the "Advanced" tab, and you open that and where it says "scripts" you browse to your script and select it, and then "OK" on the tab. It should run on your next KDE login.

    Comment


      #3
      Re: autostart bash script problem

      Thanks. I was trying to make it executable via the properties. The command worked better. I was also unaware of the autostart as part of the system settings.

      Here is my script:
      Code:
      #!/bin/bash
      
      rutilt -p "New profile"
      It starts fine but then asks me for my root password. What do I need to add to not need the password?

      Comment


        #4
        Re: autostart bash script problem

        If it requires you to run it as root, you can open your /etc/sudoers file with `visudo' and add the following line (replace "USERNAME" with your username, and "/path/to/rutilt" with the path to the command):
        Code:
        USERNAME ALL = NOPASSWD: /path/to/rutilt
        Or, if you want, the following snippet should add the entry to your sudoers file (MAKE SURE YOU USE THE DOUBLE ARROWS AND SINGLE QUOTES):
        Code:
        sudo bash -c 'echo $SUDO_USER ALL = NOPASSWD: $(which rutilt) >> /etc/sudoers'
        Then, prepend the command in your script with "sudo" so it looks like this:
        Code:
        #!/bin/bash
        
        sudo rutilt -p "New profile"
        Edit: This will allow you to run `rutilt' with root privileges without having to enter your password.
        Asus G1S-X3:
        Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

        Comment


          #5
          Re: autostart bash script problem

          @integr8e -- how good to hear from you! Welcome back!

          Comment


            #6
            Re: autostart bash script problem

            Thanks!

            I've been busy learning and doing other things, but I think I'll begin spending time on the forums again
            Asus G1S-X3:
            Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

            Comment

            Working...
            X