F
F
fokin_nikolay19892016-12-13 13:04:21
linux
fokin_nikolay1989, 2016-12-13 13:04:21

Is it possible to prevent software from running on centos?

Is it possible to implement a script on bash that would not allow the launch of a second copy of the Client part on a PC with centos 6.4
the label itself has the content

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[ru_RU]=xfce4_xicon1
Exec=/mnt/po/client.sh
Icon=xfce4_xicon1

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
vaut, 2016-12-13
@vaut

Add the creation of a pid file and checking for its existence in client.sh.
Something like this:
linuxhub.ru/viewtopic.php?t=1626

C
CityCat4, 2016-12-13
@CityCat4

You can modify client.sh in such a way that it searches for a running copy and, if found, quietly glues bots with diagnostics that the slippers are already taken :) Since it is apparently graphical, you can even issue diagnostics through some window :)
UPD: The easiest way:

var1=`ps -ax | grep client-process-name | grep -v grep`
if [ $#var1 -ne 0 ]; then
   echo 'Тапки заняты!'
   exit 100
fi

E
Eugene Ray, 2017-04-26
@firezhek

Use the fasterxml.jackson library, it parses any jackson well)
https://www.mkyong.com/java/how-to-convert-java-ob...

D
Dimonchik, 2017-04-24
@dimonchik2013

there is no json.loads() in java?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question