stabile/support/mon/save_watch.cgi @ master
1 | 95b003ff | Origo | #!/usr/bin/perl
|
---|---|---|---|
2 | # save_watch.cgi
|
||
3 | # Update an existing watch group
|
||
4 | |||
5 | require './mon-lib.pl'; |
||
6 | &ReadParse(); |
||
7 | $conf = &get_mon_config(); |
||
8 | $watch = $conf->[$in{'idx'}]; |
||
9 | if ($in{'delete'}) { |
||
10 | &save_directive($conf, $watch, undef); |
||
11 | }
|
||
12 | else { |
||
13 | $watch->{'values'} = [ $in{'group'} ]; |
||
14 | &save_directive($conf, $watch, $watch); |
||
15 | }
|
||
16 | &flush_file_lines(); |
||
17 | &redirect("list_watches.cgi"); |