###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007 Michael Tremer & Christian Schmidt #
+# Copyright (C) 2010 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
############################################################################################################################
############################################################################################################################
-print "$ARGV[0] $ARGV[1]";
-
if ( "$ARGV[0]" eq "mount" ) {
system("/bin/cp -f /etc/fstab $fstab");
{
@deviceline = split( /\;/, $deviceentry );
if ( "$ARGV[1]" eq "$deviceline[2]" ) {
- print "Insert /dev/$deviceline[0] ($deviceline[1]) --> $deviceline[2] into /etc/fstab!\n";
+ print "Insert $deviceline[0] ($deviceline[1]) --> $deviceline[2] into /etc/fstab!\n";
unless ( -d $deviceline[2] ) { system("/bin/mkdir -p $deviceline[2] && chmod 0777 $deviceline[2]"); }
open(FILE, ">>$fstab");
- print FILE "/dev/$deviceline[0]\t$deviceline[2]\t$deviceline[1]\tdefaults\t0\t0\n";
+ print FILE "$deviceline[0]\t$deviceline[2]\t$deviceline[1]\tdefaults\t0\t0\n";
close(FILE);
}
}
if ( ! `/bin/mount | /bin/fgrep $ARGV[1]` ) {
system("/bin/cp -f /etc/fstab $fstab");
system("/bin/fgrep -v $ARGV[1] <$fstab >/etc/fstab");
- print "Succesfully umounted $ARGV[1].\n";
+ print "Successfully umounted $ARGV[1].\n";
exit(0);
} else {
print "Can't umount $ARGV[1].\n";
exit(1);
}
+} elsif ( "$ARGV[0]" eq "scanhd") {
+ system("/usr/local/bin/scanhd $ARGV[1]");
+
} else {
- print "Usage: $0 (mount|umount) mountpoint\n";
+ print "Usage: $0 (mount|umount|scanhd) mountpoint\n";
}
############################################################################################################################