dev.md: added service.sh doc

This commit is contained in:
2021-10-06 10:33:56 +02:00
17 changed files with 305 additions and 58 deletions

View File

@@ -1,25 +1,37 @@
# init.sh developer's reference
## Table of content
* [1. Getting started](#1-getting-started)
* [2. The aaa_error.sh file](#2-the-aaa_errorsh-file)
+ [2.1. Functions](#21-functions)
- [init.sh developer's reference](#initsh-developers-reference)
- [1. Getting started](#1-getting-started)
- [2. The aaa_error.sh file](#2-the-aaa_errorsh-file)
- [2.1. Functions](#21-functions)
- [2.1.1. check_root](#211-check_root)
- [2.1.2. die [--force] \<exitcode\>](#212-die---force-exitcode)
- [2.1.3. noerror [--noout] \<command\>](#213-noerror---noout-command)
+ [2.2. Other functionalities](#22-other-functionalities)
* [3. The display.sh file](#3-the-displaysh-file)
+ [3.1. Functions](#31-functions)
- [2.2. Other functionalities](#22-other-functionalities)
- [3. The display.sh file](#3-the-displaysh-file)
- [3.1. Functions](#31-functions)
- [3.1.1. prnt [I|W|E|m] \<message\>](#311-prnt-iwem-message)
+ [3.2. Other functionalities](#32-other-functionalities)
* [4. The filefct.sh file](#4-the-filefctsh-file)
+ [4.1. Functions](#41-functions)
- [3.2. Other functionalities](#32-other-functionalities)
- [4. The filefct.sh file](#4-the-filefctsh-file)
- [4.1. Functions](#41-functions)
- [4.1.1. stdtime](#411-stdtime)
- [4.1.2. backupdist \<list_of_files_or_dirs\>](#412-backupdist-list_of_files_or_dirs)
- [4.1.3. installfile \<sources\> \<destination\>](#413-installfile-sources-destination)
+ [4.2. Other functionalities](#42-other-functionalities)
* [5. The pkgman.sh file](#5-the-pkgmansh-file)
- [4.2. Other functionnalities](#42-other-functionnalities)
- [5. The pkgman.sh file](#5-the-pkgmansh-file)
- [5.1. Global dependencies](#51-global-dependencies)
- [5.2. Functions](#52-functions)
- [5.2.1. pkgupdt](#521-pkgupdt)
- [5.2.2. pkginst \<package_list\>](#522-pkginst-package_list)
- [5.2.3. pkgupgd](#523-pkgupgd)
- [5.2.4. pkgrem \<package_list\>](#524-pkgrem-package_list)
- [5.2.3. pkgupgd](#523-pkgupgd)
- [5.3. Other functionnalities](#53-other-functionnalities)
- [6. The services.sh files](#6-the-servicessh-files)
- [6.1. Global dependencies](#61-global-dependencies)
- [6.2. Functions](#62-functions)
- [6.2.1. exec_serv \<service\> \<command\>](#621-exec_serv-service-command)
## 1. Getting started
This is a developer's reference. It's not intended to be a manual, but a
@@ -90,7 +102,7 @@ The first parameter is the header type, having those possible values:
- Anything else will be treated as the message and will lose alignment.
The second parameter is the message to display.
### 3.2. Other functionalities
Using that script will declare some easy to remember variables containing Bash
color codes:
@@ -98,12 +110,14 @@ color codes:
- Standard codes depending on your environment: DEFAULTFG,
DEFAULTBG, DEFAULTCOL=*${DEFAULTBG}${DEFAULTFG}*
- Regular colors: Black, Red, Green, Yellow, Blue, Purple, Cyan, White
- Bold: BBlack, BRed, BGreen, BYellow, BBlue, BPurple, BCyan, BWhite
- Bold (only available in graphical console or some non standard console
fonts): BBlack, BRed, BGreen, BYellow, BBlue, BPurple, BCyan, BWhite
- Underline: UBlack, URed, UGreen, UYellow, UBlue, UPurple, UCyan, UWhite
- Background: On_Black, On_Red, On_Green, On_Yellow, On_Blue, On_Purple,
On_Cyan, On_White
- High intensity: IBlack, IRed, IGreen, IYellow, IBlue, IPurple, ICyan, IWhite
- Bold high intensity: BIBlack, BIRed, BIGreen, BIYellow, BIBlue, BIPurple,
- Bold high intensity (only available in graphical console or some non standard
console fonts): BIBlack, BIRed, BIGreen, BIYellow, BIBlue, BIPurple,
BICyan, BIWhite
- High intensity backgrounds: On_IBlack, On_IRed, On_IGreen, On_IYellow,
On_IBlue, On_IPurple, On_ICyan, On_IWhite
@@ -118,7 +132,8 @@ echo -e "${IRed}${On_IYellow}ATTENTION:${DEFAULTBG} this is a warning!${DEFAULTC
### 4.1. Functions
#### 4.1.1. stdtime
Display date and time based on RFC 3339 standard but slightly modified so it can
be used in filename.
be used in filename. Thus spaces are replaced by dash, and comas between hours,
minutes and seconds are removed.
That function takes no parameters and return its result on standard output.
@@ -169,7 +184,7 @@ accomplish that function.
That function takes no parameters and any given parameters will be ignored.
#### 5.2.2. pkginst
#### 5.2.2. pkginst \<package_list\>
That function installs using the package manager the packages given in
parameters. The list of parameters are all considered as package names.
@@ -188,7 +203,7 @@ accomplish that function.
That function takes no parameters and any given parameters will be ignored.
#### 5.2.4. pkgrem
#### 5.2.4. pkgrem \<package_list\>
That function uninstalls using the package manager the packages given in
parameters. The list of parameters are all considered as package names.
@@ -222,6 +237,7 @@ the originally UpStart "service" program tend to be available on many systems
and is privileged.
### 6.2. Functions
<<<<<<< HEAD
#### 6.2.1. exec_serv
That function execute the given action to the given service. The service have
to be the first parameter and the action, the second parameter. No more
@@ -255,4 +271,7 @@ That function relies on the previously documented exec_serv function.
### 6.3. Other functionnalities
That file don't profide any other things that the previously listed functions.
=======
#### 6.2.1. exec_serv \<service\> \<command\>
>>>>>>> 0ed780d80de8e1be1d0d99d045c8d4b4d27d52ac