Advertisement
swaggboi

Untitled

May 30th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.71 KB | None | 0 0
  1. root@swaggserver-01:/home/daniel# ./bin/snip.pl
  2. not reachable!!
  3. restart zebra ospfd ospf6d... Failed to restart zebra\x20ospfd\x20ospf6d.service: Unit not found.
  4. Done!!
  5. waiting 9 seconds to cont... root@swaggserver-01:/home/daniel#
  6. root@swaggserver-01:/home/daniel# cat bin/snip.pl
  7. #!/usr/bin/env perl
  8.  
  9. use strict;
  10. use warnings;
  11.  
  12. my $svmgr = "systemctl";
  13. my $svact = "restart";
  14. my @svcs = ("zebra", "ospfd", "ospf6d");
  15. my $sleepy = 9;
  16.  
  17. sub rest_svc {
  18.     print "not reachable!!\n$svact @svcs... ";
  19.     system("$svmgr", "$svact", "@svcs");
  20.     print "Done!!\nwaiting $sleepy seconds to cont... ";
  21.     sleep ($sleepy);
  22. }
  23.  
  24. rest_svc();root@swaggserver-01:/home/daniel#
  25. root@swaggserver-01:/home/daniel#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement