Reputation: 1617
The systems admin are preventing me from restarting multiple services sudo systemctl restart service1 service2
.
Is there a way to get around this with a bash script.
Upvotes: 1
Views: 3450
Reputation: 1185
Create a file e.g.: touch ~/restart.sh
Make it executable e.g.: chmod 775 ~/restart.sh
Put the following code inside:
#!/bin/sh
for service; do systemctl restart "$service"; done
Run it with sudo ~/restart.sh service1 service2
Upvotes: 1