Tag Archives: linux counter

Linux counter client

http://linuxcounter.net
http://linuxcounter.net/user/207256.html

Register new machine and get LiCo “Machine ID” and “Update key”.

1. Login to your profile.

userid 207256
password xyz

2. Add user cron to launch Linux counter update script.
useradd -m cron

3. Install lico-update.sh script.

cd /usr/local/bin
wget -N --no-cache https://github.com/alexloehner/linuxcounter-update-examples/raw/master/_official/lico-update.sh
chown root:root /usr/local/bin/lico-update.sh
chmod 755 /usr/local/bin/lico-update.sh

4. Install cron.d job.
/etc/cron.d/linuxcounter

00 21 * * 0 cron /usr/local/bin/lico-update.sh -m >> /var/log/lico-update 2>&1
30 21 1 * * root /usr/local/bin/lico-update.sh -update && chmod 755 /usr/local/bin/lico-update.sh>> /var/log/lico-update 2>&1

chown root:root /etc/cron.d/linuxcounter
chmod 644 /etc/cron.d/linuxcounter
touch /var/log/lico-update
chown root:cron /var/log/lico-update
chmod 664 /var/log/lico-update
mkdir /root/.linuxcounter/
ln -s /home/cron/.linuxcounter/$(hostname) /root/.linuxcounter/

5. Register new machine, choose option [1] Create a new machine in your linuxcounter account.

su cron -
/usr/local/bin/lico-update.sh -i
cat /home/cron/.linuxcounter/$(hostname)
/usr/local/bin/lico-update.sh -m

Upgrade from version 0.3.20 to 0.0.4 😉

Proceed with steps 3. and 4. above.
Copy your ApiKey from your Profile.

su - cron

Keep your “update_key” and “machine_number” from already registered machine.
grep 'update_key\|machine_number' /home/cron/.linuxcounter/$(hostname)

/usr/local/bin/lico-update.sh -i

Choose option [3] Rescan the system and replace the current configuration with the scanned data.

Open your favorite editor:
vi /home/cron/.linuxcounter/$(hostname)

Use your “update_key” and “machine_number” you got above:

update_key='xxxxxxxxx'
machine_number='nnnnnn'

And paste values in new variables “machine_updatekey” and “machine_id”.

machine_updatekey=""
machine_id=""

Send new data to server:
/usr/local/bin/lico-update.sh -m

As user #root try script update function:
/usr/local/bin/lico-update.sh -update && chmod 755 /usr/local/bin/lico-update.sh