Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Manual hunk edit mode -- see bottom for a quick guide
- @@ -50,6 +67,36 @@
- - $tmpl = gc $f_tmpl
- - $dump = gc $f_dump
- + if ( $Result -eq 1 ) {
- + Write-Host "Quick Check zeigt Unterschiede"
- + line_check
- + }
- + else {
- + Write-Host "Firewall OK"
- + }
- +}
- +
- +function quick_check {
- +
- + $file_check = Test-Path $f_tmpl
- + if ( ! $file_check ) {
- + Write-Host "ERROR: Konnte die Datei $f_tmpl nicht finden"
- + exit 1
- + }
- +
- + fw-export($f_dump)
- +
- + $script:tmpl = gc $f_tmpl
- + $script:dump = gc $f_dump
- +
- + if ( Compare-Object $tmpl $dump ) {
- + return 1
- + }
- + else {
- + return 0
- + }
- +}
- +
- +function line_check {
- + Write-Host "Starte Line Check"
- $max_lines = gc $f_tmpl | Measure-Object -Line | Select-Object -expand L
- ines
- $line = 0
- # ---
- # To remove '-' lines, make them ' ' lines (context).
- # To remove '+' lines, delete them.
- # Lines starting with # will be removed.
- #
- # If the patch applies cleanly, the edited hunk will immediately be
- # marked for staging. If it does not apply cleanly, you will be given
- # an opportunity to edit again. If all lines of the hunk are removed,
- # then the edit is aborted and the hunk is left unchanged.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement