Mike Frysinger wrote:
> On Sunday 20 August 2006 08:01, paul kölle wrote:
>> How do I get the name of the called script in /etc/init.d? Better ideas?
>
> use $SVCNAME
>
> see the sshd init.d script for some examples
thanks mike, you got me started ;)
actually there is plenty of choice here:
gentoo ~ # cat /etc/init.d/dummy
#!/sbin/runscript
start() {
einfo "$(set)"
}
leads to:
gentoo ~ # ls -l /etc/init.d/
.
-rwxr-x--- 1 root root 267 Aug 20 17:10 dummy2
lrwxrwxrwx 1 root root 18 Aug 20 17:12 dummy2.v1 -> /etc/init.d/dummy2
.
gentoo ~ # /etc/init.d/dummy2.v1 start
* rc_name is: dummy2.v1
* myservice is: dummy2.v1
* myscript is: /etc/init.d/dummy2.v1
* SVCNAME is: dummy2.v1
* BASH_ARGV[1]: /etc/init.d/dummy2.v1
* BASH_SOURCE[0]: /etc/init.d/dummy2.v1
I'll stick with SVCNAME for now ;)
thanks again,
Paul
--
[email protected] mailing list