0

I want to execute this command in Ubuntu 14.04

sudo ./crclient -u username -i eth0

I will use it for login in cyberrom client. So need some help to create a bash script and add in to a startup like windows startup.

kek
  • 490
  • 1
  • 4
  • 19
Tech T
  • 3

1 Answers1

0

Here is the code you want to make in a shell script.

#!/bin/sh echo -n "Enter your username and press enter: " read name sudo ./crclient -u $name -i eth0

in ubuntu open dash (the ubuntu button) and type startup

then you get this:

enter image description here

Press add and type at the command rule:

incase of the ubuntu terminal gnome-terminal -x "sh /path/to/script.sh"

incase of xterm (which i prefer) xterm -e "sh /path/to/your/script.sh"

then reboot and see if it works :)

---------------------------EDIT---------------------------

make a new file in /etc/xdg/autostart using nano/vi or a text editor and name it test.dekstop

copy this into it

[Desktop Entry] Name=MyScript GenericName=test Comment=test Exec=/path/to/my/script.sh Terminal=true Type=Application X-GNOME-Autostart-enabled=true

reboot the pc afterwards

______________________EDIT 2______________________

To allow the command to run without sudo asking for a password, do the following:

visudo

scroll all the way down and add this

linuxusername ALL= NOPASSWD: path/to/crclient

save and exit

patrick
  • 513