Skip to content
Snippets Groups Projects
Commit 1dd7f078 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

Merge branch 'le-multiterminal-lic' of /home/git/repositories/le5/unstable

parents 87b1be9b b4be117f
No related branches found
No related tags found
No related merge requests found
Showing
with 119 additions and 0 deletions
Package: le-multiterminal-lic
Priority: important
Section: main
Version: 0.0.3
Maintainer: LE Maintainer <le-maintainer@c3sl.ufpr.br>
Description: Userful multiplier license for Linux Educacional 5
Architecture: all
Pre-Depends: userful-multiseat
Depends: le-multiterminal
#!/bin/bash
#
# Copyright (C) 2004-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-multiterminal-lic
#
# le-multiterminal-lic is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
MacAddr=""
Lic=""
LicExt="1Box.info"
DirLic="/etc/userful/license"
PackageLic=""
SysId=$(cat /etc/userful/sys-id)
LicF=${SysId}.${LicExt}
function macAddr () {
if ifconfig | grep -q "eth0"; then
MacAddr=$(ifconfig | grep -i eth0 | awk -F " " '{print $7}' | tr ':' '-' |tr '[:lower:]' '[:upper:]')
Lic=${MacAddr}.${LicExt}
else
echo "Eth0 not found, fix it and run dpkg-reconfigure le-multiterminal-lic"
exit 0
fi
}
function checkPackage () {
local found=""
for i in $(ls /tmp/lic/*.bz2); do
if tar -tf $i | grep -q $MacAddr; then
PackageLic=$i
found="true"
break
fi
done
if [ -z "$found" ]; then
echo "License not found for this machine."
exit 0
fi
}
function checkLic () {
local posCheck=$1
if [ -f "$DirLic/$LicF" ]; then
if [ -z "$posCheck" ]; then
echo "License already installed"
exit 0;
else
echo "License successfully installed"
fi
fi
}
function extractLic () {
tar -xjf $PackageLic -C /tmp/ $Lic
mv -f /tmp/$Lic $DirLic/$LicF
}
###
macAddr
# Checks if license has already been installed
checkLic
# Checks if there is license in the package
checkPackage
# Extracts and install license
extractLic
# Checks if the license was installed
checkLic "1"
#!/bin/bash
#
# Copyright (C) 2004-2012 Centro de Computacao Cientifica e Software Livre
# Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
#
# This file is part of le-multiterminal-lic
#
# le-multiterminal-lic is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
LicExt="1box.info"
DirLic="/etc/userful/license"
if [ -f $DirLic/*$LicF ]; then
rm -f $DirLic/*$LicF
fi
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment