LinuxParty
NUESTRO SITIO necesita la publicidad para costear hosting y el dominio. Por favor considera deshabilitar tu AdBlock en nuestro sitio. También puedes hacernos una donación entrando en linuxparty.es, en la columna de la derecha.
Código: | #!/usr/bin/env perl use strict; use warnings; my $modem = "/dev/ttyUSB0"; # my $modem = "/dev/usb/tts/0"; # Substitute xxxx with your PIN. # You should probably put your pin somewhere else, e.g. on an USB stick, # an encrypted file system or something else, and read it from there... # You have been warned! my $pin = "1234"; $SIG{ALRM} = sub { die("timeout: no response from modem $modem\n"); }; open(MODEM, "+<", $modem) or die("can't open modem $modem"); alarm(10); print(MODEM "AT+CPIN=\"$pin\"\n\r"); while (<MODEM>) { if (m/OK/) { close(MODEM); print("PIN accepted\n"); exit(0); } if (m/ERROR/) { close(MODEM); print("PIN rejected\n"); exit(1); } } |
Lo digo, por que en caso de estar mal, debeis de observar la imagen y escribirlo, tal cual.
kwrite, puede ser una buena herramienta.
