![]() |
Re: [Announce] easyroot -- an even better way of becoming root
Well, you can join the club and use same trick as above in your root script if you wish. Just modify gainroot as becomeroot does, possibly leaving out the echo, useless test for MODE etc, and launch su - from your root script via sudo gainroot like above. Would that be acceptable?
|
Re: [Announce] easyroot -- an even better way of becoming root
I've made the changes suggested by fanoush. Version 1.0-2 should now be backward-compatible with 'sudo gainroot', plus I use exec whenever possible. Please give it a try.
|
Re: [Announce] easyroot -- an even better way of becoming root
Seems to work! Thanks!
EDIT: Oops that was premature. See next post. |
Re: [Announce] easyroot -- an even better way of becoming root
Oops. No it doesn't work...
I do get root, but no sourcing of .profile or .bashrc and I still get the 7 lines of output. |
Re: [Announce] easyroot -- an even better way of becoming root
Are you typing 'root'?
Regarding 7 lines output, I realized that my package only saves 1 line. If you want to eliminate logging entirely, install bash from a parallel thread. |
Re: [Announce] easyroot -- an even better way of becoming root
Yes I typed 'root' and it did take me to root. I tried rebooting. I tried both .profile and .bashrc. I could source them manually of course.
Thanks for the tip about bash. |
Re: [Announce] easyroot -- an even better way of becoming root
Yes, '-' is missing after running su from /usr/sbin/gainroot in this version.
BTW the $@ expands to all arguments so you may get unexpected arguments inside [ ], try running it like "sudo gainroot 1 2 3". Maybe something easier like Code:
if [ "$1" = "--use-su" ] ; then Code:
[ "$1" = "--use-su" ] && exec su - |
Re: [Announce] easyroot -- an even better way of becoming root
Quote:
|
Re: [Announce] easyroot -- an even better way of becoming root
Quote:
fanoush - thanks for the tip about $@. |
Re: [Announce] easyroot -- an even better way of becoming root
for those who will use becomeroot anyway and dont want to type sudo gainroot anytime, just make an alias like i do and save it under /home/user/.profile
file contains alias sg="sudo gainroot" from now u only have to type sg to "becomeroot" |
All times are GMT. The time now is 21:10. |
vBulletin® Version 3.8.8