0

i need to execute the following commands AFTER login.

sudo hdparm -y /dev/disk/by-uuid/443AFBAD7FE50945

sudo hdparm -y /dev/disk/by-uuid/7ABB49654B799D40

(trying to edit rc.local does not work nor does using hdparm.conf because as soon as I log in the disks start up again). I have tried numerous things like bash files and autossh entries in the startup applications with no luck because sudo is involved.

i have tried the rc.local, the .bashrc, the autossh in startup, hdparm.conf. none of these options have worked

1 Answers1

-1

You can do:

echo #password | sudo -S #commmand

Replace #password with your password and #command with a command you want to execute.

EDIT 1: More secure way that takes a little bit of time
1) Run: "sudo apt-get install monodevelop"
2) Download https://www.dropbox.com/s/6917qfhc6mwc9jw/MountVolumens.tar.gz
3) Extract it where ever you want
4) Open "MountVolumens.sln" with monodevelop
5) At line 24 replace #password with your password
6) At line 25 write down all the commands you want to execute
7) Press Ctrl + F8
8) At line 24 remove your password
9) Go to the folder where you extracted the files, than go to "MountVolumens/bin/Debug", and there you should see a file called MountVolumens.exe
10) Copy it where ever you want, and create a sh script that just says "cd #location && mono MountVolumens.exe", replace #location with "MountVolumens.exe" folder location

mmm3743
  • 348