- or download this
#!/usr/bin/perl
use strict;
use warnings;
...
print '<h1>Device is connected</h1>';
}
print '</body></html>';
- or download this
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "<html><head><title>Umount</title></head><body>";
system("sudo", "umount", "/dev/sda1");
print "</body></html>";
- or download this
$ mount -a
- or download this
$ mount
/dev/sda1 on /mnt/usbstick type vfat (rw,relatime,uid=1000,gid=100
+0,fmask=0137,dmask=0027,codepage=437,iocharset=ascii,shortname=mixed,
+utf8,errors=remount-ro)
- or download this
$ curl http://localhost/cgi-bin/admin/Q/panel/panelmin.pl
<html><head><title>USB test</title></head><body><h1>Device is conn
+ected</h1></body></html>
- or download this
$ curl http://localhost/cgi-bin/admin/Q/panel/umount.pl
<html><head><title>Umount</title></head><body></body></html>
- or download this
$ curl http://localhost/cgi-bin/admin/Q/panel/panelmin.pl
<html><head><title>USB test</title></head><body><h1>USB device not
+ connected</h1></body></html>
- or download this
$ df -h | grep /dev/sda1
/dev/sda1 15G 366M 15G 3% /mnt/usbstick
- or download this
$ sudo umount /dev/sda1
$ df -h | grep /dev/sda1
- or download this
$ mount -a (as superuser)
$ df -h | grep /dev/sda1
/dev/sda1 15G 366M 15G 3% /mnt/usbstick
- or download this
$ perl panelmin.pl
Content-type:text/html
<html><head><title>USB test</title></head><body><h1>Device is conn
+ected</h1></body>
- or download this
$ perl umount.pl
Content-type:text/html
<html><head><title>Umount</title></head><body></body></html>
- or download this
$ perl panelmin.pl
Content-type:text/html
<html><head><title>USB test</title></head><body><h1>USB device not
+ connected</h1></body></html>
- or download this
$ df -h | grep /dev/sda1
- or download this
use autodie qw(:all)