tis-schedule-shutdown-daily

1.1-3
Trigger a shutdown everyday
282 downloads
Download
default icon

  Description 

  • package : tis-schedule-shutdown-daily
  • version : 1.1-3
  • architecture : all
  • categories : System and network
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Kenan KILICARSLAN
  • description : Trigger a shutdown everyday
  • locale :
  • target_os : windows
  • min_wapt_version : 1.7
  • sources :
  • installed_size :
  • impacted_process :
  • description_fr : Lance un arrêt du poste tous les jours
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence :
  • signature_date : 2020-11-19T11:54:00.916468

  Setup.py 

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

uninstallkey = []

# Defining variables
task_name = 'ShutdownDaily'
start_hour = 19
start_minute = 00


def install():
    # Creating the scheduled task
    if task_exists(task_name):
        delete_task(task_name)
    try:
        print('Creating the task: %s' % task_name)
        create_daily_task(task_name, 'shutdown','/s /t 300', start_hour=start_hour, start_minute=start_minute)
    except:
        print('Unable to create the task: %s' % task_name)


def uninstall():
    # Deleting the scheduled task
    if task_exists(task_name):
        try:
            delete_task(task_name)
        except:
            print('Unable to delete the task: %s' % task_name)


def audit():
    if not task_exists(task_name):
        print("task %s don't exist, WAPT is installing package to fix that" % task_name)
        install()
        return "WARNING"
    if not enable_task(task_name):
        print("task %s is disable, WAPT is going to enable the task" % task_name)
        enable_task(task_name)
        return "WARNING"
    else:
        print("task %s exist and is active" % task_name)
        return "OK"


def update_package():
    # Initializing variables
    version = control.version.split('-')[0]

    # Incrementing version of the package
    control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
    control.save_control_to_wapt()
    print('Changing package version to: %s in WAPT\\control' % control.version)


										

  Changelog 



No changelog.txt.
									
  manifest.sha256