-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.sh
executable file
·58 lines (53 loc) · 1.17 KB
/
utils.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env dash
#
# Copyright (C) 2024-2025 Maria Lisina
# Copyright (C) 2024-2025 Danil Lisin
# SPDX-License-Identifier: Apache-2.0
#
# Run this software with `env -i` to avoid variable conflict
set -e
umask 77
dir="${0%/*}"
utils="${dir}/utils"
if [ -n "${1}" ]
then
action="${1}"
shift
case "${action}" in
(help)
help=0
;;
(aliases)
. "${utils}/aliases.sh"
;;
(blacklist)
. "${utils}/blacklist.sh"
;;
(whitelist)
. "${utils}/whitelist.sh"
;;
(list)
. "${utils}/list.sh"
;;
(*)
echo "Unrecognized action or util ${action}" \
"\nSee '${0} help'"
exit 1
;;
esac
else
help=0
fi
if [ -n "${help}" ]
then
echo "Sekoohaka Bot Utils" \
"\n\nUsage: ${0} [util] [action]" \
"\n\nActions:" \
"\n help\t\tShow help information" \
"\n\nUtils:" \
"\n aliases\tAliases Manager" \
"\n blacklist\tBlacklist Manager" \
"\n whitelist\tWhitelist Manager" \
"\n list\t\tList Supported Image Boards"
exit 0
fi