tcp17019: make service proto and netdir arguments optional (for aux/listen1)
this allows /rc/bin/service/tcp17019 to be called from aux/listen1 without arguments like: aux/listen1 tcp!*!rcpu /rc/bin/service/tcp17019
This commit is contained in:
parent
9a55346264
commit
978628d679
1 changed files with 5 additions and 3 deletions
|
@ -1,8 +1,10 @@
|
|||
#!/bin/rc
|
||||
if(~ $#* 3){
|
||||
netdir=$3
|
||||
remote=$2!`{cat $3/remote}
|
||||
}
|
||||
fn server {
|
||||
echo -n $netdir $remote >/proc/$pid/args
|
||||
~ $#remote 0 || echo -n $netdir $remote >/proc/$pid/args
|
||||
rm -f /env/'fn#server'
|
||||
. <{n=`{read} && ! ~ $#n 0 && read -c $n} >[2=1]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue