tis-waptupgrade icon

WAPT Agent

Silent install package for WAPT Agent

2.6.0.17392-0

  • package: tis-waptupgrade
  • name: WAPT Agent
  • version: 2.6.0.17392-0
  • categories: System and Network
  • maintainer: WAPT Team,Jimmy PELÉ,Hubert TOUVET,Simon Fonteneau
  • editor: Tranquil IT
  • target_os: debian_based
  • impacted_process: waptconsole,waptself,wapt-get,waptmessage,wapttray,waptexit
  • architecture: x64
  • signature_date:
  • size: 44.58 Mo
  • homepage : https://www.wapt.fr

package           : tis-waptupgrade
version           : 2.6.0.17392-0
architecture      : x64
section           : base
priority          : critical
name              : WAPT Agent
categories        : System and Network
maintainer        : WAPT Team,Jimmy PELÉ,Hubert TOUVET,Simon Fonteneau
description       : Deployement of the WAPT Agent (with the WAPT Console)
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : debian_based
min_wapt_version  : 2.1
sources           : 
installed_size    : 
impacted_process  : waptconsole,waptself,wapt-get,waptmessage,wapttray,waptexit
description_fr    : Déploiement de l'agent WAPT (avec la console WAPT)
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Tranquil IT
keywords          : 
licence           : 
homepage          : https://www.wapt.fr
package_uuid      : 07b82d22-1276-4ce6-87c3-d5a782227f9d
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 6dc8f2da8919852f729d395f63b92a33a0304323c3535981d335a50a83273ca5
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-08-03T10:17:27.000000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
signature         : a7Y3woj6xZ+P85Er78pXNQzUo19QxlbJKIu+FX/U0z9BqPEBYwYGoc88x2Yildgbvcz5EawUgOQOjRo6t71KT65LCiLgWKIt6tfA8SrYkkO5++ZzhzTnmXydXI9yQiPK6QHX3ZYiI5LuRN33OE39IyuPOtrWEUZo4Tee2vrMZHRpOOwxO9Dke5N76we2praRyHojJdY//r5Qo41dH83d8LV3UHw0DUUrbZSsvCY2wAo9U8G3JlYJ/dSKvR0rjdQ4xEcqSb+uDbxVHTakFlpCuLEGoeknf/+CJqMMTapflZYLhFkjuoMfco/fymroiNBbAVpEqiq/hc29buiBOrPxaQ==

# -*- coding: utf-8 -*-
from setuphelpers import *
import time
import glob

temp_dir = makepath("/tmp")


def create_systemd_onetime_task(name, user, cmd, delay_minutes=2):
    """
    Create cron task
    """
    run_time = time.localtime(time.time() + delay_minutes * 60)

    hour_min = time.strftime("%H:%M:%S", run_time)
    date = time.strftime("%Y-%m-%d", run_time)

    cmd = "systemd-run --on-calendar='%s %s' --description='%s' %s " % (date, hour_min, name, cmd)
    print("Create scheduled task with command : %s" % cmd)
    run(cmd)

def installed_wapt_version():
    try:
        with open(os.path.join(WAPT.wapt_base_dir, "version-full")) as fver:
            installed_wapt_version = fver.read()
    except:
        installed_wapt_version = "0.0.0.0"

    return installed_wapt_version

def install():

    if is_redhat_based():
        waptagent_package_file = glob.glob('*.rpm')[0]
    else:
        waptagent_package_file = glob.glob('*.deb')[0]

    print("Install %s" % control.asrequirement())

    if isfile(makepath(WAPT.wapt_base_dir, "waptserver", "server.py")):
        print("Wapt server installed on this host. Aborting")
        return "OK"

    package_wapt_version = control.get_software_version()

    if force or Version(installed_wapt_version()) < package_wapt_version:
        filecopyto(waptagent_package_file, temp_dir)
        waptagent_file = makepath(temp_dir, waptagent_package_file)
        install_cmd = ""
        if is_redhat_based():
            install_cmd = "yum install %s -y" % waptagent_file
        elif is_debian_based():
            install_cmd = "/usr/bin/apt install -f -y %s" % waptagent_file
        create_systemd_onetime_task("waptupgrade", "root", install_cmd)
    else:
        print("Your current wapt (%s) is same or more recent than the upgrade package (%s). Skipping..." % (installed_wapt_version, package_wapt_version))

def audit():
    # Comparing installed WAPT agent version and package version
    (package_wapt_version, package_packaging) = control.version.split("-")

    if Version(installed_wapt_version()) < control.get_software_version():
        print(
            "The installed version of the WAPT agent and the version of the package are not corresponding. The installation may have just finished. If this warning persists one day after installation, please take this into consideration."
        )
        return "WARNING"
    else:
        print("The installed version of the WAPT agent and the version of the package are corresponding.")
        return "OK"

# -*- coding: utf-8 -*-
from waptpackage import PackageEntry
from setuphelpers import *
import json

def update_package():
    data = json.loads(wgets('https://wapt.tranquil.it/wapt/releases/latest/wapt_agent_list.json'))

    for entry in data:
        p = PackageEntry()
        p.package = 'tis-waptupgrade'
        p.min_os_version = entry['wapt_min_os_version']
        p.max_os_version = entry['wapt_max_os_version']
        p.target_os = entry['wapt_target_os']
        p.architecture = entry['wapt_architecture']

        if "tis-waptagent-gui" in entry['url'] :
            continue

        if not WAPT.host_capabilities().is_matching_package(p):
            continue

        matchentry = entry
        break

    wget(matchentry['url'],matchentry['url'].split('/')[-1],sha256=matchentry['file_sha256'])

    control.target_os = matchentry['wapt_target_os']
    control.min_os_version = matchentry['wapt_min_os_version']
    control.max_os_version = matchentry['wapt_max_os_version']
    control.architecture = matchentry['wapt_architecture']
    control.set_software_version(matchentry['wapt_version'])
    control.save_control_to_wapt()


38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
d07a30a722d3c00e38eb696fe55eb7636af0486bd0c8bb0acf8454d120e1e9e4 : WAPT/control
6dc8f2da8919852f729d395f63b92a33a0304323c3535981d335a50a83273ca5 : WAPT/icon.png
125449c093dc63373d5c2073a202e7b66a2ff25d81c9cf5846e7d8eb007bcc9e : luti.json
06f06db0fda321601b2e6923c18f033e57e49fe300ecffe07d8ab6122bf180c1 : setup.py
5d06da862da871eb4f09316f0ae5e4f1f1ba170e28edafab930cde3cf4b6d224 : tis-waptagent-2.6.0.17392-0ac7bf48-amd64.deb
46855e804ab5fdc78d104518b46f8af8be373d418bf0b30c94da6adb28853f53 : update_package.py