0.2.1 #2
|
@ -1,5 +1,4 @@
|
|||
old/
|
||||
VoidServiceControl/main.py
|
||||
__pycache__
|
||||
.idea
|
||||
.venv
|
||||
|
|
19
README.md
19
README.md
|
@ -1,6 +1,12 @@
|
|||
# Void Service Control (VSC)
|
||||
## A simple script that will allow you to manage runit services in Void Linux
|
||||
|
||||
## Available on:
|
||||
[![](https://cloud.orudo.ru/apps/files_sharing/publicpreview/RpcoJB8FwgNmqHC?file=/&fileId=48757&x=1920&y=1200&a=true&etag=10effec96382ba8b9fc181a5c1c85012)](https://git.orudo.ru/trueold89/void-service-control)
|
||||
[![](https://cloud.orudo.ru/s/D8xtkTS8ZBCq8fC/download/GH.png)](https://github.com/Trueold89/void-service-control)
|
||||
|
||||
***
|
||||
|
||||
- [Installation](#install)
|
||||
- [Usage](#usage)
|
||||
- [Build from sources](#build-from_sources)
|
||||
|
@ -14,7 +20,7 @@
|
|||
From [git.orudo.ru](https://git.orudo.ru/trueold89/void-service-control/releases):
|
||||
|
||||
```bash
|
||||
$ pip install https://git.orudo.ru/trueold89/void-service-control/releases/download/0.2/VoidServiceControl-0.2.tar.gz
|
||||
$ pip install https://git.orudo.ru/trueold89/void-service-control/releases/download/0.2.1/VoidServiceControl-0.2.1.tar.gz
|
||||
```
|
||||
or pypi
|
||||
|
||||
|
@ -26,6 +32,12 @@ $ pip install void-service-control
|
|||
|
||||
**Or by downloading the pre-built binary / xbps-package from the **[releases](https://git.orudo.ru/trueold89/void-service-control/releases)** page**
|
||||
|
||||
#### Install [.xbps package](https://git.orudo.ru/trueold89/void-service-control/releases):
|
||||
|
||||
```bash
|
||||
& xbps-rindex -a *.xbps && xbps-install --repository=$PWD void-service-control
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### Usage:
|
||||
|
@ -42,6 +54,11 @@ $ vsc e <service_name>
|
|||
$ vsc d <service_name>
|
||||
```
|
||||
|
||||
**Action with multiple services:**
|
||||
```bash
|
||||
$ vsc e <first_service_name> <second_service_name>
|
||||
```
|
||||
|
||||
**Print help:**
|
||||
|
||||
```bash
|
||||
|
|
|
@ -70,12 +70,10 @@ class Args(object):
|
|||
"""
|
||||
Checks the arguments
|
||||
"""
|
||||
if len(self.__arguments) == 0:
|
||||
raise TypeError(lang.errors["usage"])
|
||||
if len(self.__arguments) != 2 and self.__arguments[0] not in Arg.HELP.value:
|
||||
raise TypeError(lang.errors["usage"])
|
||||
if self.__arguments[0] in Arg.HELP.value:
|
||||
if len(self.__arguments) == 1 and self.__arguments[0] in Arg.HELP.value:
|
||||
raise Help()
|
||||
if len(self.__arguments) < 2:
|
||||
raise TypeError(lang.errors["usage"])
|
||||
if self.__arguments[0] not in Arg.all():
|
||||
raise TypeError(lang.errors["args"])
|
||||
|
||||
|
@ -91,7 +89,7 @@ class Args(object):
|
|||
|
||||
def __iter__(self):
|
||||
yield self.__action()
|
||||
yield self.__arguments[1]
|
||||
yield self.__arguments[1:]
|
||||
|
||||
|
||||
class Service(object):
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
from VoidServiceControl.classes import Su, Interface, Args, Help
|
||||
|
||||
|
||||
def main() -> None:
|
||||
try:
|
||||
Su()
|
||||
action, services = tuple(Args())
|
||||
for service_name in services:
|
||||
service = Interface(service_name)
|
||||
service.action(action)
|
||||
del service
|
||||
except TypeError as e:
|
||||
print(f"{e}\n\n{Help()}")
|
||||
except (ValueError, PermissionError, Help) as e:
|
||||
print(e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -0,0 +1,12 @@
|
|||
# Template file for 'void-service-control'
|
||||
pkgname=void-service-control
|
||||
version=
|
||||
revision=1
|
||||
build_style=python3-module
|
||||
hostmakedepends="python3-setuptools"
|
||||
short_desc="A simple script that will allow you to manage runit services in Void Linux"
|
||||
maintainer="Trueold89 <trueold89@orudo.ru>"
|
||||
license="GPL-3"
|
||||
homepage="https://git.orudo.ru/trueold89/void-service-control"
|
||||
distfiles="https://git.orudo.ru/trueold89/void-service-control/releases/download/${version}/VoidServiceControl-${version}.tar.gz"
|
||||
checksum=
|
Loading…
Reference in New Issue