Hi, i want to slow internet everyday during the night time, back to normal day time. I am not experienced in scripts. I found in one of the similar topics this example commands,
uci set sqm.eth1.upload='4000'
uci set sqm.eth1.download='5000'
uci commit sqm
service sqm restart
as an example. how should i paste it in scheduled tasks. and how will get back to normal each morning? ı will be very pleased if you explain it step by step
you only need to execute them once, can even skip the restart, then start the sqm service in the evening.
you stop the sqm service via cron.
maybe it is a very basic question , what command should i exactly put to cron to stop and restart sqm service
it is.
service sqm stop
/ service sqm start
Easiest is to create two short scripts in /etc , e.g. slow.sh and speedup.sh, and place the sqm config change commands and service restart in them.
Then you can just run that script from the cron timings (instead of having multiple commands in the crontab line.
if sqm is only on or off, there's no need for the script, you simple stop or start it ?
I think that SQM should likely be always on, and the task is more about adjusting limits (and restarting sqm) in the morning and evening.
guess only OP can tell us how it's supposed to be.
but yes, if you need to reconfigure it between day and night, then it should be scripted.
You can adjust CAKE bandwidth “live” without restarting SQM:
#!/bin/sh
sqmiface="uci get sqm.@queue[-1].interface"
tc qdisc change root dev "$sqmiface" cake bandwidth 4Mbit
tc qdisc change root dev ifb4"$sqmiface" cake bandwidth 10Mbit
The first line is for upload, the second for download.
The foolproof method is to do what is already proposed above. But I like to be the daring fool…
adjusting limits is a better solution for me, after preparing scripts should i put it like
in scheduled tasks
0 1 * * * /etc/slow.sh
0 7 * * * /etc/speedup.sh
to slow it at 1am , back to normal at 7?
no opinion about the hours, but syntax looks good.
thanks everyone