package Common;

require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw( commands );

use strict;
use warnings;
use File::Copy qw( copy );
use Data::Dumper;
use FindBin qw( $Bin );

sub commands {
  my $pen_path = "$Bin/../..";

  my @path = split /\//, $Bin;

  open(F, "> /machine_model");
  print F "$path[-1]\n";
  close(F);

  unlink("/etc/udev/rules.d/70-persistent-net.rules");

  # custom stuff
  if (-e "$Bin/../software/custom_commands") {
    system("chmod 755 $Bin/../software/custom_commands");
    system("$Bin/../software/custom_commands");
  }

  # grub
  if (-e "$Bin/../software/grub") {
    copy("$Bin/../software/grub", "/etc/default/grub");
    system("update-grub");
  }

  unlink "/.multitouch" if -e "/.multitouch";
}

1;

