Good day, can anyone fill this command for CoreCtrl app for my rc.local? Thanks.
#!/bin/bash
/sbin/ip addr | grep inet\ | tail -n1 | awk '{ print $2 }' > /etc/issue
echo "" >> /etc/issue
exit 0
Good day, can anyone fill this command for CoreCtrl app for my rc.local? Thanks.
#!/bin/bash
/sbin/ip addr | grep inet\ | tail -n1 | awk '{ print $2 }' > /etc/issue
echo "" >> /etc/issue
exit 0
what rc.local
?
… seems you talk about a different init system - systemd is used in Arch/Manjaro
documenting my steps to decipher this:
which ip
yields:
/usr/bin/ip
so: that is not even the same path to begin with
but it will work because /sbin
is a symlink to /usr/bin
where the ip
command actually resides (in Manjaro)
what does it do?
ip addr | grep inet\ | tail -n1 | awk '{ print $2 }'
That part of the command will give you your machines current IP and netmask -
the next part will then feed it into the file /etc/issue
(which is only possible as root)
which is not the place to put that information
as that file has a different purpose (and content already)
and it will overwrite it, destroying the original content
That file will then be written to again, appending … nothing
echo "" >> /etc/issue
to the now altered content
You will lose the original content of /etc/issue
- and you will get no output in return
if you where asking what the command returns
Yeah forgot. Can you please fill in for me a crontab then?
Yes the app is in /usr/bin, just replace anything you must. I just want to run it before login with root privileges via root crontab.
Use @reboot
This might help:
I just want to sudo crontab -e and write @reboot something, no destructive time events, just always on. What is this @reboot something for the specific app? Thanks.
Something like this?
sudo (crontab -l ; echo "@reboot /path/to/your/script/script.sh") | crontab -
no, sorry
Just sudo crontab -e then edit with VI to something like @reboot sh /usr/bin/corectrl, but didn’t work. At any rate is there a simple way to start a root app before login so i get away without password?
This is ambiguous.
And possibly not a good way to do it.
Have you heard of the term “XY problem”?
…
What is it that you want to achieve?
Sorry for the delay dialog. So some applications require root access. If you choose them as simple startup applications, then during each startup and when you first see your desktop you will prompted with a password window, or the specific app will not start. Is there any way to start it in an earlier step?
No, because then they would not be able to bind to your GUI
Please give an example !
Is the option of elevating the rights with a dropin sudoers config file in /etc/sudoers.d/
a way to skip the request to authenticate eg:
Yourusername ALL=(root) NOPASSWD:/path/to/program
I’ve never played with this but it seems like a solution for the situation described.