Webfiltering TaskManager

Hi

i created this script to be deployed via task manager

I pushed it to all our devices, and created a success and fail tag dependent on the outcome
99% of the units returned a sucess tag

however I’m not seeing the list of all the blacklisted sites referenced via web filter > site blocking within each unit?

uci set hostblock.config.enabled=‘1’
uci set hostblock.config.mode=‘blacklist’

uci set hostblock.@block[0].id=‘.anonymous’
uci set hostblock.@block[0].enabled=‘1’
uci set hostblock.@block[0].host=‘netflix.com,youtube.com,spotify.com,twitch.tv,facebook.com,instagram.com,disneyplus.com,hulu.com,amazon.com,primevideo.com,apple.com,appletv.com,crunchyroll.com,hbo.com,hbomax.com,peacocktv.com,paramountplus.com,showtime.com,starz.com

uci set hostblock.@block[1].id=‘.anonymous2’
uci set hostblock.@block[1].enabled=‘1’
uci set hostblock.@block[1].host=‘twitter.com,linkedin.com,pinterest.com,reddit.com,tumblr.com,snapchat.com,tiktok.com,vimeo.com,dailymotion.com,imdb.com,rottentomatoes.com,metacritic.com

uci commit hostblock
/etc/init.d/hostblock restart

Hello,

Thank you for reaching out.

Unfortunately, you cannot add all desired hostnames into a single hostblock element. Instead, each hostname you wish to block must be specified in a separate hostblock element. Below is the proper set of commands that need to be executed via Task Manager:

uci add hostblock block
uci set hostblock.@block[0].host=www.youtube.com
uci set hostblock.@block[0].enabled=1
uci add hostblock block
uci set hostblock.@block[1].host=www.netflix.com
uci set hostblock.@block[1].enabled=1
uci add hostblock block
uci set hostblock.@block[2].host=www.spotify.com
uci set hostblock.@block[2].enabled=1 
# Repeat for other hostnames
uci set hostblock.config.enabled=1
uci commit hostblock
/etc/init.d/hostblock restart

If you need further assistance or have additional questions, please feel free to reach out.

Best regards,

This topic was automatically closed after 60 days. New replies are no longer allowed.