Just edit the output folder to /www in that line would do the trick you mean, or anything else required?
For testing that's enough.
Since /www (/ really) is stored on flash, you should output associated_stations.htm to /tmp, and create a soft link to it from /www, to avoid flash wear.
I didn't test yet this new script, because the first one from OP does not work propperly on my acesspoint. And I am affraid, the error will be still the same.
I must have something wrong configured or there is missing a package.
The ethers and hosts files get generated with all the IP's and Hostnames, but on the status overview appears MAC with IP's only. The hostnames are still missing.
On my main router this is working, only on the ap not. Anybody a hint where to find the error?
ship the ethers file from the main router.
Sorry to ask, but how can this be done?
On main router
root@OpenWrt:~# cd /www
root@OpenWrt:/www# ln -s /etc/ethers .
on AP:
cd /tmp
wget http://main.router.I.P/ethers
cat /tmp/ethers > /etc/ethers
what I wrote about the script four posts earlier applies here too - consider the flash wear.
Thank you!
But, the ethers and hosts files are generated fine on the AP. I think it would not help if I replace them with the ones from my main router.
then I don't understand your question, but it's OT in this thread anyway ...
I think I give up here.
Changed that one line for the output directory to /www.
Still the same error pointing to the old folder.
Don“t know if there is another line in that script what points again to the old folder.
Maybe you could restore the original files and compare the permissions of your files with mine:
![]()
![]()
![]()
![]()
in folder pr_home
-rw-r--r-- 1 root root 9459 Jun 10 12:13 associated_stations.sh
in folder /usr/lib/lua/luci view
-not created the file associated_stations.htm
in folder /usr/lib/lua/luci/controller
-rw-r--r-- 1 root root 187 Jun 9 14:00 associated_stations.lua
in folder /usr/lib/lua/associated_stations
-rw-r--r-- 1 root root 147 Jun 9 14:57 associated_stations.lua
the .sh does not have the same permissions, why?
I was changing the chmod command in the last line of the .sh to
chmod +x $OUTPUT_FILE (was before chmod 644) but also not running.
Changing output folder to /www was also not successful.
Ok; let's assume you have succesfully restored all "my original files".
Just to be sure, check your /pr_home directory permissions:
![]()
Now execute chmod +x associated_stations.sh and then manually launch the sh script to see if it creates the htm file. ![]()
Thanks a lot
That is working now. Just started the LuCI menu entry and I got the output! Well done I would say!!!!
But ![]()
I am on the main router and I see its DHCP leases.
It only shows phy0 and phy1 not br-lan
Column Host is next to the MAC and just shows the mac address again - no hostname
Column IP shows Unknown - Means no ip address
Can I change that or why does it not display these details?
Glad to hear it works, well done!
I believe "names" are not displayed because in your device are different: you have to find out them and change the .sh script accordingly. Nevertheless, as my main router doesn't run OpenWrt right now, another point of improvement would probabily be adapting it to an actual router environment,.
How can I run this cronjob for br-lan.1 and br-lan.100 at once?
I wrote you a reply to show you how I solved for me what you're looking for.
Instead of a single command in the cron job, it was a script that simply loops through all br-lan VLANs and calls the arp-scan command for each one.
However, I am not permitted to show you this, as someone suggested that the four lines were AI-generated, which is why the post was removed.
You now have the basic approach (as I said, this is exactly how it works for me here). So, instead of a single command, a script across the interfaces in the cron-job. However, you will have to figure out the exact details yourself - I am not interested in engaging in immature discussions about justification.
Thanks, I saw your post before it removed.
Im looking for a single commandā¦
Now I use
*/2 * * * * arp-scan -qxdlN -I br-lan.1; arp-scan -qxdlN -I br-lan.100
But iām not sure if itās the best way to do that.
Maybe should use && instead of ; or maybe completely another way..
This would basically be exactly what the loop would have achieved manually (if you only have these two VLANs).
Both (; or &&) would work in principle. The difference between ; and && is simply that with &&, the next command is only executed if the first one does not report an error.
So the question is: Do you want to execute the command for br-lan.100 even if the arp scan for br-lan.1 returned an error, or should it be aborted?
Yes, I will stick with the ; for that job