diff --git a/etc/ahenk/ahenk.conf b/config/ahenk.conf similarity index 89% rename from etc/ahenk/ahenk.conf rename to config/ahenk.conf index 6281122..449a65b 100644 --- a/etc/ahenk/ahenk.conf +++ b/config/ahenk.conf @@ -3,7 +3,7 @@ logconfigurationfilepath = /etc/ahenk/log.conf dbpath = /etc/ahenk/ahenk.db [PLUGIN] -pluginfolderpath = /opt/ahenk/plugins/ +pluginfolderpath = /usr/share/ahenk/plugins/ mainmodulename = main [CONNECTION] diff --git a/etc/ahenk/log.conf b/config/log.conf similarity index 100% rename from etc/ahenk/log.conf rename to config/log.conf diff --git a/debian/ahenk.install b/debian/ahenk.install deleted file mode 100644 index 4e26f3e..0000000 --- a/debian/ahenk.install +++ /dev/null @@ -1,4 +0,0 @@ -opt/ / -etc/ / -lib/ / -usr/ / diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 6d37e7a..0000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ahenk (1.0) unstable; urgency=low - - * Ahenk core app - - -- volkansahin Thu, 10 Dec 2015 22:21:04 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec63514..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/control b/debian/control deleted file mode 100644 index 48845c9..0000000 --- a/debian/control +++ /dev/null @@ -1,12 +0,0 @@ -Source: ahenk -Section: unknown -Priority: optional -Maintainer: TUBITAK ULAKBIM -Build-Depends: debhelper (>= 9) -Standards-Version: 3.9.5 -Homepage: http://www.liderahenk.org.tr - -Package: ahenk -Architecture: any -Depends: bash, python3 (>= 3), cython, libidn11, libidn11-dev, python3-dev, python3-pip, python3-watchdog, libffi-dev, libssl-dev, python3-paramiko, python3-cpuinfo, python3-psutil (>= 4), libpam-script, python3-sleekxmpp, dmidecode, python3-easygui, notify-osd, read-edid -Description: Lider Ahenk is an open source project which provides solutions to manage, monitor and audit unlimited number of different systems and users on a network. diff --git a/debian/files b/debian/files deleted file mode 100644 index 8bc2437..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -ahenk_1.0_amd64.deb unknown optional diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index f8d9145..0000000 --- a/debian/postinst +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -# postinst script for ahenk -# -# see: dh_installdeb(1) - -set -e - - -case "$1" in - configure) - -while true; do - read -p "Eğer makinada var olan bir pam konfigurasyonu varsa geçersiz hale gelecektir.Devam etmek istiyor musunuz? [e/H]" eH - case $eH in - [e] ) - if [ -d /usr/share/pam-configs ] - then - echo -e "Name: Support for authentication by external scripts\nDefault: yes\nPriority: 257\nSession-Type: Additional\nSession:\n\toptional\tpam_script.so" > /usr/share/pam-configs/pam_script - DEBIAN_FRONTEND=noninteractive pam-auth-update - fi - break;; - [H] ) exit;; - * ) echo "Lütfen e ya da H karakterleri ile yanıtlayın!";; - esac -done - - systemctl --system daemon-reload - systemctl enable ahenk.service - - update-rc.d ahenk defaults - /etc/init.d/ahenk start - - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -exit 0 diff --git a/debian/prerm b/debian/prerm deleted file mode 100644 index 297f69e..0000000 --- a/debian/prerm +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# prerm script for ahenk -# -/usr/bin/python3 /opt/ahenk/ahenkd.py clean -find /opt/ahenk | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf diff --git a/debian/rules b/debian/rules deleted file mode 100755 index cfe67d3..0000000 --- a/debian/rules +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#DH_VERBOSE = 1 - -# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* -DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - - -# main packaging script based on dh7 syntax -%: - dh $@ - -# debmake generated override targets -# This is example for Cmake (See http://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- \ -# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) diff --git a/usr/share/libpam-script/pam_script_ses_close b/libpam-script/pam_script_ses_close similarity index 91% rename from usr/share/libpam-script/pam_script_ses_close rename to libpam-script/pam_script_ses_close index 344d77f..f5bab47 100755 --- a/usr/share/libpam-script/pam_script_ses_close +++ b/libpam-script/pam_script_ses_close @@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then TTY_DISPLAY="$PAM_TTY" fi log "logout: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY" - sudo python3 /opt/ahenk/ahenkd.py logout $PAM_USER + sudo python3 /usr/share/ahenk/ahenkd.py logout $PAM_USER fi fi diff --git a/usr/share/libpam-script/pam_script_ses_open b/libpam-script/pam_script_ses_open similarity index 89% rename from usr/share/libpam-script/pam_script_ses_open rename to libpam-script/pam_script_ses_open index 00b5450..3512806 100755 --- a/usr/share/libpam-script/pam_script_ses_open +++ b/libpam-script/pam_script_ses_open @@ -25,6 +25,6 @@ if [ -n $PAM_USER ] && [ $PAM_USER != "root" ]; then TTY_DISPLAY="$PAM_TTY" fi log "login: $PAM_USER service: $SERVICE tty: $TTY_DISPLAY" - sudo python3 /opt/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY + sudo python3 /usr/share/ahenk/ahenkd.py login $PAM_USER $SERVICE $TTY_DISPLAY fi fi diff --git a/scripts/build-ahenk.sh b/scripts/build-ahenk.sh deleted file mode 100755 index a914070..0000000 --- a/scripts/build-ahenk.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -### -# This script generates Ahenk package (ahenk.deb). -# Make sure you have debhelper & build-essential packages installed! -# -# Generated file can be found under /tmp/ahenk -### -set -e - -pushd $(dirname $0) > /dev/null -PRJ_ROOT_PATH=$(dirname $(pwd -P)) -popd > /dev/null -echo "Project path: $PRJ_ROOT_PATH" - -# Generate Ahenk packages -echo "Generating Ahenk packages..." -cd "$PRJ_ROOT_PATH" -dpkg-buildpackage -b -uc -echo "Generated Ahenk packages" - -EXPORT_PATH=/tmp/ahenk -echo "Export path: $EXPORT_PATH" - -# Copy resulting files -echo "Copying generated Ahenk packages to $EXPORT_PATH..." -mkdir -p "$EXPORT_PATH" -cp -rf "$PRJ_ROOT_PATH"/../ahenk*.deb "$EXPORT_PATH" -cp -rf "$PRJ_ROOT_PATH"/../ahenk*.changes "$EXPORT_PATH" -echo "Copied generated Ahenk packages." - -echo "Built finished successfully!" -echo "Files can be found under: $EXPORT_PATH" diff --git a/scripts/checkout-ahenk.sh b/scripts/checkout-ahenk.sh deleted file mode 100755 index ca015d7..0000000 --- a/scripts/checkout-ahenk.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -### -# This script updates the local repo with the latest changes from Github. -# -# The master branch will be REPLACED with what's in Github and all local changes -# will be LOST. -### - -git checkout master -git fetch -f origin -git fetch --tags origin -git reset --hard origin/master diff --git a/etc/init.d/ahenk b/service-files/ahenk similarity index 100% rename from etc/init.d/ahenk rename to service-files/ahenk diff --git a/lib/systemd/system/ahenk.service b/service-files/ahenk.service similarity index 59% rename from lib/systemd/system/ahenk.service rename to service-files/ahenk.service index a6083de..420dc39 100644 --- a/lib/systemd/system/ahenk.service +++ b/service-files/ahenk.service @@ -4,8 +4,8 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/python3 /opt/ahenk/ahenkd.py start -ExecStop=/usr/bin/python3 /opt/ahenk/ahenkd.py stop +ExecStart=/usr/bin/python3 /usr/share/ahenk/ahenkd.py start +ExecStop=/usr/bin/python3 /usr/share/ahenk/ahenkd.py stop PIDFile=/var/run/ahenkd.pid Restart=always diff --git a/opt/ahenk/__init__.py b/src/__init__.py similarity index 100% rename from opt/ahenk/__init__.py rename to src/__init__.py diff --git a/opt/ahenk/ahenkd.py b/src/ahenkd.py old mode 100755 new mode 100644 similarity index 100% rename from opt/ahenk/ahenkd.py rename to src/ahenkd.py diff --git a/opt/ahenk/api/service/ps_util.py b/src/api/service/ps_util.py similarity index 100% rename from opt/ahenk/api/service/ps_util.py rename to src/api/service/ps_util.py diff --git a/opt/ahenk/base/__init__.py b/src/base/__init__.py similarity index 100% rename from opt/ahenk/base/__init__.py rename to src/base/__init__.py diff --git a/opt/ahenk/base/agreement/agreement.py b/src/base/agreement/agreement.py similarity index 98% rename from opt/ahenk/base/agreement/agreement.py rename to src/base/agreement/agreement.py index a27faa2..97c54f0 100644 --- a/opt/ahenk/base/agreement/agreement.py +++ b/src/base/agreement/agreement.py @@ -14,7 +14,7 @@ class Agreement: self.message_manager = scope.get_message_manager() self.messenger = scope.get_messenger() self.db_service = scope.get_db_service() - self.ask_path = '/opt/ahenk/base/agreement/ask.py' + self.ask_path = '/usr/share/ahenk/base/agreement/ask.py' self.logger.debug('Instance initialized.') def agreement_contract_update(self): diff --git a/opt/ahenk/base/agreement/ask.py b/src/base/agreement/ask.py old mode 100755 new mode 100644 similarity index 100% rename from opt/ahenk/base/agreement/ask.py rename to src/base/agreement/ask.py diff --git a/opt/ahenk/base/agreement/confirm.py b/src/base/agreement/confirm.py old mode 100755 new mode 100644 similarity index 100% rename from opt/ahenk/base/agreement/confirm.py rename to src/base/agreement/confirm.py diff --git a/opt/ahenk/base/command/command_manager.py b/src/base/command/command_manager.py similarity index 100% rename from opt/ahenk/base/command/command_manager.py rename to src/base/command/command_manager.py diff --git a/opt/ahenk/base/command/command_runner.py b/src/base/command/command_runner.py similarity index 100% rename from opt/ahenk/base/command/command_runner.py rename to src/base/command/command_runner.py diff --git a/opt/ahenk/base/command/fifo.py b/src/base/command/fifo.py similarity index 100% rename from opt/ahenk/base/command/fifo.py rename to src/base/command/fifo.py diff --git a/opt/ahenk/base/config/__init__.py b/src/base/config/__init__.py similarity index 100% rename from opt/ahenk/base/config/__init__.py rename to src/base/config/__init__.py diff --git a/opt/ahenk/base/config/config_manager.py b/src/base/config/config_manager.py similarity index 100% rename from opt/ahenk/base/config/config_manager.py rename to src/base/config/config_manager.py diff --git a/opt/ahenk/base/database/ahenk_db_service.py b/src/base/database/ahenk_db_service.py similarity index 100% rename from opt/ahenk/base/database/ahenk_db_service.py rename to src/base/database/ahenk_db_service.py diff --git a/opt/ahenk/base/deamon/__init__.py b/src/base/deamon/__init__.py similarity index 100% rename from opt/ahenk/base/deamon/__init__.py rename to src/base/deamon/__init__.py diff --git a/opt/ahenk/base/deamon/base_daemon.py b/src/base/deamon/base_daemon.py similarity index 100% rename from opt/ahenk/base/deamon/base_daemon.py rename to src/base/deamon/base_daemon.py diff --git a/opt/ahenk/base/event/event_base.py b/src/base/event/event_base.py similarity index 100% rename from opt/ahenk/base/event/event_base.py rename to src/base/event/event_base.py diff --git a/opt/ahenk/base/event/event_manager.py b/src/base/event/event_manager.py similarity index 100% rename from opt/ahenk/base/event/event_manager.py rename to src/base/event/event_manager.py diff --git a/opt/ahenk/base/execution/__init__.py b/src/base/execution/__init__.py similarity index 100% rename from opt/ahenk/base/execution/__init__.py rename to src/base/execution/__init__.py diff --git a/opt/ahenk/base/execution/execution_manager.py b/src/base/execution/execution_manager.py similarity index 100% rename from opt/ahenk/base/execution/execution_manager.py rename to src/base/execution/execution_manager.py diff --git a/opt/ahenk/base/file/file_transfer_manager.py b/src/base/file/file_transfer_manager.py similarity index 100% rename from opt/ahenk/base/file/file_transfer_manager.py rename to src/base/file/file_transfer_manager.py diff --git a/opt/ahenk/base/file/http_file_transfer.py b/src/base/file/http_file_transfer.py similarity index 100% rename from opt/ahenk/base/file/http_file_transfer.py rename to src/base/file/http_file_transfer.py diff --git a/opt/ahenk/base/file/ssh_file_transfer.py b/src/base/file/ssh_file_transfer.py similarity index 100% rename from opt/ahenk/base/file/ssh_file_transfer.py rename to src/base/file/ssh_file_transfer.py diff --git a/opt/ahenk/base/logger/__init__.py b/src/base/logger/__init__.py similarity index 100% rename from opt/ahenk/base/logger/__init__.py rename to src/base/logger/__init__.py diff --git a/opt/ahenk/base/logger/ahenk_logger.py b/src/base/logger/ahenk_logger.py similarity index 100% rename from opt/ahenk/base/logger/ahenk_logger.py rename to src/base/logger/ahenk_logger.py diff --git a/opt/ahenk/base/mail/mail_manager.py b/src/base/mail/mail_manager.py similarity index 100% rename from opt/ahenk/base/mail/mail_manager.py rename to src/base/mail/mail_manager.py diff --git a/opt/ahenk/base/messaging/__init__.py b/src/base/messaging/__init__.py similarity index 100% rename from opt/ahenk/base/messaging/__init__.py rename to src/base/messaging/__init__.py diff --git a/opt/ahenk/base/messaging/anonymous_messenger.py b/src/base/messaging/anonymous_messenger.py similarity index 100% rename from opt/ahenk/base/messaging/anonymous_messenger.py rename to src/base/messaging/anonymous_messenger.py diff --git a/opt/ahenk/base/messaging/message_response_queue.py b/src/base/messaging/message_response_queue.py similarity index 100% rename from opt/ahenk/base/messaging/message_response_queue.py rename to src/base/messaging/message_response_queue.py diff --git a/opt/ahenk/base/messaging/messaging.py b/src/base/messaging/messaging.py similarity index 100% rename from opt/ahenk/base/messaging/messaging.py rename to src/base/messaging/messaging.py diff --git a/opt/ahenk/base/messaging/messenger.py b/src/base/messaging/messenger.py similarity index 100% rename from opt/ahenk/base/messaging/messenger.py rename to src/base/messaging/messenger.py diff --git a/opt/ahenk/base/model/__init__.py b/src/base/model/__init__.py similarity index 100% rename from opt/ahenk/base/model/__init__.py rename to src/base/model/__init__.py diff --git a/opt/ahenk/base/model/enum/__init__.py b/src/base/model/enum/__init__.py similarity index 100% rename from opt/ahenk/base/model/enum/__init__.py rename to src/base/model/enum/__init__.py diff --git a/opt/ahenk/base/model/enum/content_type.py b/src/base/model/enum/content_type.py similarity index 100% rename from opt/ahenk/base/model/enum/content_type.py rename to src/base/model/enum/content_type.py diff --git a/opt/ahenk/base/model/enum/message_code.py b/src/base/model/enum/message_code.py similarity index 100% rename from opt/ahenk/base/model/enum/message_code.py rename to src/base/model/enum/message_code.py diff --git a/opt/ahenk/base/model/enum/message_type.py b/src/base/model/enum/message_type.py similarity index 100% rename from opt/ahenk/base/model/enum/message_type.py rename to src/base/model/enum/message_type.py diff --git a/opt/ahenk/base/model/message_factory.py b/src/base/model/message_factory.py similarity index 100% rename from opt/ahenk/base/model/message_factory.py rename to src/base/model/message_factory.py diff --git a/opt/ahenk/base/model/modes/__init__.py b/src/base/model/modes/__init__.py similarity index 100% rename from opt/ahenk/base/model/modes/__init__.py rename to src/base/model/modes/__init__.py diff --git a/opt/ahenk/base/model/modes/init_mode.py b/src/base/model/modes/init_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/init_mode.py rename to src/base/model/modes/init_mode.py diff --git a/opt/ahenk/base/model/modes/login_mode.py b/src/base/model/modes/login_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/login_mode.py rename to src/base/model/modes/login_mode.py diff --git a/opt/ahenk/base/model/modes/logout_mode.py b/src/base/model/modes/logout_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/logout_mode.py rename to src/base/model/modes/logout_mode.py diff --git a/opt/ahenk/base/model/modes/safe_mode.py b/src/base/model/modes/safe_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/safe_mode.py rename to src/base/model/modes/safe_mode.py diff --git a/opt/ahenk/base/model/modes/shutdown_mode.py b/src/base/model/modes/shutdown_mode.py similarity index 100% rename from opt/ahenk/base/model/modes/shutdown_mode.py rename to src/base/model/modes/shutdown_mode.py diff --git a/opt/ahenk/base/model/plugin.py b/src/base/model/plugin.py similarity index 100% rename from opt/ahenk/base/model/plugin.py rename to src/base/model/plugin.py diff --git a/opt/ahenk/base/model/plugin_bean.py b/src/base/model/plugin_bean.py similarity index 100% rename from opt/ahenk/base/model/plugin_bean.py rename to src/base/model/plugin_bean.py diff --git a/opt/ahenk/base/model/policy.py b/src/base/model/policy.py similarity index 100% rename from opt/ahenk/base/model/policy.py rename to src/base/model/policy.py diff --git a/opt/ahenk/base/model/policy_bean.py b/src/base/model/policy_bean.py similarity index 100% rename from opt/ahenk/base/model/policy_bean.py rename to src/base/model/policy_bean.py diff --git a/opt/ahenk/base/model/profile.py b/src/base/model/profile.py similarity index 100% rename from opt/ahenk/base/model/profile.py rename to src/base/model/profile.py diff --git a/opt/ahenk/base/model/profile_bean.py b/src/base/model/profile_bean.py similarity index 100% rename from opt/ahenk/base/model/profile_bean.py rename to src/base/model/profile_bean.py diff --git a/opt/ahenk/base/model/response.py b/src/base/model/response.py similarity index 100% rename from opt/ahenk/base/model/response.py rename to src/base/model/response.py diff --git a/opt/ahenk/base/model/task.py b/src/base/model/task.py similarity index 100% rename from opt/ahenk/base/model/task.py rename to src/base/model/task.py diff --git a/opt/ahenk/base/model/task_bean.py b/src/base/model/task_bean.py similarity index 100% rename from opt/ahenk/base/model/task_bean.py rename to src/base/model/task_bean.py diff --git a/opt/ahenk/base/plugin/__init__.py b/src/base/plugin/__init__.py similarity index 100% rename from opt/ahenk/base/plugin/__init__.py rename to src/base/plugin/__init__.py diff --git a/opt/ahenk/base/plugin/abstract_plugin.py b/src/base/plugin/abstract_plugin.py similarity index 100% rename from opt/ahenk/base/plugin/abstract_plugin.py rename to src/base/plugin/abstract_plugin.py diff --git a/opt/ahenk/base/plugin/file_handler.py b/src/base/plugin/file_handler.py similarity index 100% rename from opt/ahenk/base/plugin/file_handler.py rename to src/base/plugin/file_handler.py diff --git a/opt/ahenk/base/plugin/plugin.py b/src/base/plugin/plugin.py similarity index 100% rename from opt/ahenk/base/plugin/plugin.py rename to src/base/plugin/plugin.py diff --git a/opt/ahenk/base/plugin/plugin_install_listener.py b/src/base/plugin/plugin_install_listener.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_install_listener.py rename to src/base/plugin/plugin_install_listener.py diff --git a/opt/ahenk/base/plugin/plugin_manager.py b/src/base/plugin/plugin_manager.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_manager.py rename to src/base/plugin/plugin_manager.py diff --git a/opt/ahenk/base/plugin/plugin_manager_factory.py b/src/base/plugin/plugin_manager_factory.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_manager_factory.py rename to src/base/plugin/plugin_manager_factory.py diff --git a/opt/ahenk/base/plugin/plugin_queue.py b/src/base/plugin/plugin_queue.py similarity index 100% rename from opt/ahenk/base/plugin/plugin_queue.py rename to src/base/plugin/plugin_queue.py diff --git a/opt/ahenk/base/registration/__init__.py b/src/base/registration/__init__.py similarity index 100% rename from opt/ahenk/base/registration/__init__.py rename to src/base/registration/__init__.py diff --git a/opt/ahenk/base/registration/registration.py b/src/base/registration/registration.py similarity index 100% rename from opt/ahenk/base/registration/registration.py rename to src/base/registration/registration.py diff --git a/opt/ahenk/base/scheduler/__init__.py b/src/base/scheduler/__init__.py similarity index 100% rename from opt/ahenk/base/scheduler/__init__.py rename to src/base/scheduler/__init__.py diff --git a/opt/ahenk/base/scheduler/base_scheduler.py b/src/base/scheduler/base_scheduler.py similarity index 100% rename from opt/ahenk/base/scheduler/base_scheduler.py rename to src/base/scheduler/base_scheduler.py diff --git a/opt/ahenk/base/scheduler/custom/__init__.py b/src/base/scheduler/custom/__init__.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/__init__.py rename to src/base/scheduler/custom/__init__.py diff --git a/opt/ahenk/base/scheduler/custom/all_match.py b/src/base/scheduler/custom/all_match.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/all_match.py rename to src/base/scheduler/custom/all_match.py diff --git a/opt/ahenk/base/scheduler/custom/custom_scheduler.py b/src/base/scheduler/custom/custom_scheduler.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/custom_scheduler.py rename to src/base/scheduler/custom/custom_scheduler.py diff --git a/opt/ahenk/base/scheduler/custom/schedule_job.py b/src/base/scheduler/custom/schedule_job.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/schedule_job.py rename to src/base/scheduler/custom/schedule_job.py diff --git a/opt/ahenk/base/scheduler/custom/scheduledb.py b/src/base/scheduler/custom/scheduledb.py similarity index 100% rename from opt/ahenk/base/scheduler/custom/scheduledb.py rename to src/base/scheduler/custom/scheduledb.py diff --git a/opt/ahenk/base/scheduler/scheduler_factory.py b/src/base/scheduler/scheduler_factory.py similarity index 100% rename from opt/ahenk/base/scheduler/scheduler_factory.py rename to src/base/scheduler/scheduler_factory.py diff --git a/opt/ahenk/base/scope.py b/src/base/scope.py similarity index 100% rename from opt/ahenk/base/scope.py rename to src/base/scope.py diff --git a/opt/ahenk/base/system/system.py b/src/base/system/system.py similarity index 97% rename from opt/ahenk/base/system/system.py rename to src/base/system/system.py index 0206eb6..7473586 100644 --- a/opt/ahenk/base/system/system.py +++ b/src/base/system/system.py @@ -10,6 +10,7 @@ import platform import re import socket import struct +import netifaces from uuid import getnode as get_mac import cpuinfo @@ -460,12 +461,17 @@ class System: @staticmethod def ip_addresses(): arr = [] - for iface in psutil.net_io_counters(pernic=True): - f = os.popen('ifconfig {0} | grep "inet\ addr" | cut -d: -f2 | cut -d" " -f1'.format(iface)) - ip = str(f.read()).replace('\n', '') - if re.match(r'^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$', + for iface in netifaces.interfaces(): + link = None + try: + link = netifaces.ifaddresses(iface)[netifaces.AF_INET][0] + except: + link = None + if link is not None: + ip = link['addr'] + if re.match(r'^((\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d{2}|2[0-4]\d|25[0-5])$', ip) and str(ip) != 'localhost' and str(ip) != '127.0.0.1': - arr.append(ip) + arr.append(ip) return arr @staticmethod diff --git a/opt/ahenk/base/task/__init__.py b/src/base/task/__init__.py similarity index 100% rename from opt/ahenk/base/task/__init__.py rename to src/base/task/__init__.py diff --git a/opt/ahenk/base/task/task_in_queue.py b/src/base/task/task_in_queue.py similarity index 100% rename from opt/ahenk/base/task/task_in_queue.py rename to src/base/task/task_in_queue.py diff --git a/opt/ahenk/base/task/task_job.py b/src/base/task/task_job.py similarity index 100% rename from opt/ahenk/base/task/task_job.py rename to src/base/task/task_job.py diff --git a/opt/ahenk/base/task/task_manager.py b/src/base/task/task_manager.py similarity index 100% rename from opt/ahenk/base/task/task_manager.py rename to src/base/task/task_manager.py diff --git a/opt/ahenk/base/timer/setup_timer.py b/src/base/timer/setup_timer.py similarity index 100% rename from opt/ahenk/base/timer/setup_timer.py rename to src/base/timer/setup_timer.py diff --git a/opt/ahenk/base/timer/timer.py b/src/base/timer/timer.py similarity index 100% rename from opt/ahenk/base/timer/timer.py rename to src/base/timer/timer.py diff --git a/opt/ahenk/base/util/util.py b/src/base/util/util.py similarity index 99% rename from opt/ahenk/base/util/util.py rename to src/base/util/util.py index cbbc706..738dbb5 100644 --- a/opt/ahenk/base/util/util.py +++ b/src/base/util/util.py @@ -316,7 +316,7 @@ class Util: @staticmethod def ask_permission(display, username, message, title): - ask_path = '/opt/ahenk/base/agreement/confirm.py' + ask_path = '/usr/share/ahenk/base/agreement/confirm.py' try: if username is not None: diff --git a/opt/ahenk/helper/__init__.py b/src/helper/__init__.py similarity index 100% rename from opt/ahenk/helper/__init__.py rename to src/helper/__init__.py