NBash

Форк
0
/
epm-prescription 
48 строк · 1.4 Кб
1
#!/bin/sh
2
#
3
# Copyright (C) 2015, 2017, 2019, 2020, 2022  Etersoft
4
# Copyright (C) 2015, 2017, 2019, 2020, 2022  Vitaly Lipatov <lav@etersoft.ru>
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
15
#
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
#
19

20
load_helper epm-play
21

22
epm_prescription()
23
{
24

25
local psdir="$CONFIGDIR/prescription.d"
26

27
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
28
    cat <<EOF
29
Options:
30
    <receipt>      - run <receipt>
31
    --list-all     - list all available receipts
32
EOF
33
    exit
34
fi
35

36
if [ "$1" = "--list-all" ] || [ -z "$*" ] ; then
37
    [ -n "$short" ] || [ -n "$quiet" ] || echo "Run with a name of a prescription to run:"
38
    __epm_play_list $psdir
39
    exit
40
fi
41

42
prescription="$1"
43
shift
44

45
__check_play_script "$prescription" || fatal "We have no idea how to play $prescription (checked in $psdir)"
46
__epm_play_run "$prescription" --run "$@" || fatal "There was some error during run the script."
47

48
}
49

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.