Q. How to automate Network Link Conditioner to toggle ON/OFF for a set time period
I am on the latest Mac OS software (at the time of writing this) - Ventura 13.4
In basic terms, I am looking to repeatedly activate and deactivate Network Link Conditioner for any given amount of time.
However, when running the .sh file in a terminal window with the code above, I get several syntax errors.
I am very new to all things scripting etc. Any help would be appreciated.
This is the code I have been working on:
#!/bin/bash
set variable "nlc"="network-link-conditioner";
async function example(){
nlc.setDelay(1);
const profiles=await nlc.getProfileNames();
await nlc.setProfile(profiles[1]);
await nlc.setProfile("100% Loss");
await nlc.on();
await nlc.off();
}
example();