Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write log entry if router is rebooted because of no internet #14

Open
teefixx opened this issue Jul 2, 2023 · 1 comment
Open

write log entry if router is rebooted because of no internet #14

teefixx opened this issue Jul 2, 2023 · 1 comment

Comments

@teefixx
Copy link

teefixx commented Jul 2, 2023

Hi all
Thank you for that great script, it works great on my Synology, surveying my B715 router.

As I'm not a programmer, would it be possible to add some line to the code to write an entry into a log file, every time the internet is gone and the router is rebooted?

I know this is a feature request, not an issue, but anyway, it would be great...

Thank you

@surfzoid
Copy link

Hi you can use an crontab with shell redirect, AKA >> mylog , i use it to start getsignal.py, also at the end of script i added :


quatreG="vas savoir!"
buchette="x"
for key, value in dico.items():
    #print(key, " : ", value)
    if key == "CurrentNetworkTypeEx" : quatreG=value
    if key == "SignalIcon" : buchette=value

if quatreG == "1011":
	print("On est en 4G+ : " + quatreG)
else :
	print("On est en 4G : " + quatreG)

print("nombre de buchettes: " + buchette)

print("Déconexion : " + client.user.logout())

if buchette <= "2" and not quatreG == "1011":
    restart = '/usr/bin/python3 huawei/b618reboot-master/reboot_router.py'
    print("Bloquer sur 2 buchettes? On redemarre le router")
    os.system(restart)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants