Why not?
Modifying system hosts configuration requires privileged file system access.
The mindset here should be default deny.
Modifying system hosts configuration requires privileged file system access.
The mindset here should be default deny.
With the proper permissions something like this should be ok, but I'd tread lightly. Especially with something that dynamically updates your hosts file.
Naturally it's on the user to properly configure the permissions.
I'm not saying this isn't a worthy project, I'm just adding to the discussion on why people should be cautious when running scripts with root permissions.