File: config

package info (click to toggle)
ssbd 0.10-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 784 kB
  • ctags: 250
  • sloc: sh: 3,538; ansic: 1,817; makefile: 116; perl: 24
file content (31 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /usr/bin/perl -w
# ssbd config

use strict;
use Debconf::Client::ConfModule q(:all);

version ('2.0');
my $udpport = '7890';
my ($s);

input('medium', 'ssbd/udpport');
go();
$udpport=get('ssbd/udpport');
 
if (-e "/etc/default/ssbd") {
    open F,"/etc/default/ssbd" or die;
}
open G,">/etc/default/ssbd.tmp" or die;
while ($s=<F>){
    chomp($s);
    if ($s=~/\s*UDPPORT\s*=\s*"?([0-9])*"?/){
        print G "UDPPORT=\"$udpport\"\n";
    }else{
        print G "$s\n";
    }
}

close F;
close G;
unlink "/etc/default/ssbd";
rename "/etc/default/ssbd.tmp","/etc/default/ssbd";