diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-05-23 09:52:24 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-05-23 09:52:24 +0000 |
commit | f7d861d97fa97f41f595fed19236bbbea6ec82b7 (patch) | |
tree | 4fef96876772c72e6ae063835b41061082a2f395 /lib | |
parent | 0b183b2611b2e59e51e5c9517f2d682e4bf3ef60 (diff) | |
download | drakx-net-f7d861d97fa97f41f595fed19236bbbea6ec82b7.tar drakx-net-f7d861d97fa97f41f595fed19236bbbea6ec82b7.tar.gz drakx-net-f7d861d97fa97f41f595fed19236bbbea6ec82b7.tar.bz2 drakx-net-f7d861d97fa97f41f595fed19236bbbea6ec82b7.tar.xz drakx-net-f7d861d97fa97f41f595fed19236bbbea6ec82b7.zip |
extract get_chat_file sub
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/connection/ppp.pm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/network/connection/ppp.pm b/lib/network/connection/ppp.pm index 496ccda..78eafa8 100644 --- a/lib/network/connection/ppp.pm +++ b/lib/network/connection/ppp.pm @@ -93,11 +93,14 @@ sub build_chat { ); } +sub get_chat_file { + my ($self) = @_; + "/etc/sysconfig/network-scripts/chat-" . $self->get_interface; +} + sub write_chat { my ($self) = @_; - my $interface = $self->get_interface; - my $chat_file = "/etc/sysconfig/network-scripts/chat-$interface"; - output_with_perm($::prefix . $chat_file, 0755, join("\n", $self->build_chat, '')); + output_with_perm($::prefix . $self->get_chat_file, 0755, join("\n", $self->build_chat, '')); } sub get_peer_default_options { @@ -113,8 +116,7 @@ sub build_peer { #- pty #- plugin if ($self->{access}{dial_number}) { - my $interface = $self->get_interface; - my $chat_file = "/etc/sysconfig/network-scripts/chat-$interface"; + my $chat_file = $self->get_chat_file; $self->{access}{peer}{connect} ||= qq("/usr/sbin/chat -v -f $chat_file"); } $self->get_peer_default_options, |