plugins bash changes

This commit is contained in:
agah 2021-08-31 15:20:27 +03:00
parent 42eeae5037
commit 199b543c6e
5 changed files with 82 additions and 80 deletions

View file

@ -72,6 +72,7 @@ class CommandRunner(object):
if str(json_data['event']) == 'login' and self.check_last_login():
username = json_data['username']
if username != "Debian-gdm":
display = json_data['display']
desktop = json_data['desktop']
@ -164,6 +165,7 @@ class CommandRunner(object):
self.execute_manager.remove_user_executed_policy_dict(username)
self.plugin_manager.process_mode('logout', username)
self.plugin_manager.process_mode('safe', username)
if username != "Debian-gdm":
self.db_service.delete('session', '1=1')
# TODO delete all user records while initializing
self.logger.info('logout event is handled for user: {0}'.format(username))

View file

@ -3,7 +3,7 @@ var=$(lsmod | awk '{print $1}'| grep usblp)
service cups stop
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "USB printer devices are already blocked"
else

View file

@ -2,7 +2,7 @@
var=$(lsmod | grep usbhid)
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "USB HID devices are already blocked"
else
@ -21,7 +21,7 @@ fi
var=$(lsmod | grep psmouse)
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "psmouse is already blocked"
else

View file

@ -2,7 +2,7 @@
var=$(lsmod | awk '{print $1}'| grep usb_storage)
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "USB storage devices are already blocked"
else
@ -26,7 +26,7 @@ sleep 2
var=$(lsmod | grep usb_storage | awk '{print $4}')
if [ ! -z "$var" ]
if [[ ! -z "$var" ]]
then
IFS=',' read -ra deps <<< "$var"
for i in "${deps[@]}"; do

View file

@ -2,7 +2,7 @@
var=$(lsof -t /dev/video0)
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "Webcam is not in use"
else
@ -12,7 +12,7 @@ fi
var=$(lsmod | awk '{print $1}'| grep uvcvideo)
if [ -z "$var" ]
if [[ -z "$var" ]]
then
echo "Webcam is already blocked"
else