penguins-eggs 9.3.22 → 9.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oclif.manifest.json +1 -1
- package/README.md +127 -64
- package/dist/commands/adapt.js +4 -2
- package/dist/commands/analyze.js +2 -2
- package/dist/commands/calamares.js +7 -2
- package/dist/commands/config.js +6 -3
- package/dist/commands/cuckoo.js +4 -6
- package/dist/commands/dad.js +6 -1
- package/dist/commands/export/deb.js +6 -1
- package/dist/commands/export/iso.js +6 -1
- package/dist/commands/install.js +6 -2
- package/dist/commands/kill.js +4 -2
- package/dist/commands/mom.js +5 -2
- package/dist/commands/produce.js +7 -8
- package/dist/commands/status.js +4 -1
- package/dist/commands/syncfrom.js +5 -3
- package/dist/commands/syncto.js +5 -3
- package/dist/commands/tools/clean.js +4 -2
- package/dist/commands/tools/ppa.js +5 -1
- package/dist/commands/tools/skel.js +5 -6
- package/dist/commands/tools/stat.js +6 -1
- package/dist/commands/tools/yolk.js +4 -2
- package/dist/commands/update.js +4 -2
- package/dist/commands/wardrobe/get.js +6 -2
- package/dist/commands/wardrobe/list.js +6 -2
- package/dist/commands/wardrobe/show.js +7 -2
- package/dist/commands/wardrobe/wear.js +7 -2
- package/dist/lib/dependencies.js +7 -6
- package/package.json +3 -3
- package/scripts/README.md +120 -0
- package/scripts/includes/common.sh +59 -0
- package/scripts/includes/easybashgui +1695 -0
- package/scripts/includes/easybashgui-debug +146 -0
- package/scripts/includes/easybashgui.lib +8039 -0
- package/scripts/includes/easybashlib +550 -0
- package/scripts/includes/easydialog-legacy +163 -0
- package/scripts/mom.sh +56 -0
- /package/scripts/{mom-cli.sh → old-mom-cli.sh} +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
#########################
|
|
4
|
+
#
|
|
5
|
+
# Copyright (C) 2020 Vittorio Cagnetta
|
|
6
|
+
#
|
|
7
|
+
# Author: Vittorio Cagnetta <vaisarger@gmail.com>
|
|
8
|
+
#
|
|
9
|
+
# This program is free software; you can redistribute it and/or modify
|
|
10
|
+
# it under the terms of the GNU General Public License as published by
|
|
11
|
+
# the Free Software Foundation; version 3 of the License.
|
|
12
|
+
#
|
|
13
|
+
# This program is distributed in the hope that it will be useful,
|
|
14
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
# GNU General Public License for more details.
|
|
17
|
+
#
|
|
18
|
+
# You should have received a copy of the GNU General Public License along with this program,
|
|
19
|
+
# called, in this distribution, "EasyBashGUI-license"; if not, write to the
|
|
20
|
+
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
21
|
+
#
|
|
22
|
+
#########################
|
|
23
|
+
#
|
|
24
|
+
############################
|
|
25
|
+
#
|
|
26
|
+
#
|
|
27
|
+
#
|
|
28
|
+
usage()
|
|
29
|
+
{
|
|
30
|
+
#
|
|
31
|
+
echo -e "Usage:>$(basename "${0}" ) [-m [mode]] [box type] <box options>"
|
|
32
|
+
echo -e "\t1)Where [modes] are:"
|
|
33
|
+
echo -e "\t a \t\t=>\t automatic (normal way)"
|
|
34
|
+
echo -e "\t g \t\t=>\t to force gtkdialog"
|
|
35
|
+
echo -e "\t k \t\t=>\t to force kdialog"
|
|
36
|
+
echo -e "\t z \t\t=>\t to force zenity"
|
|
37
|
+
echo -e "\t x \t\t=>\t to force Xdialog"
|
|
38
|
+
echo -e "\t d \t\t=>\t to force (c)dialog"
|
|
39
|
+
echo -e "\t n \t\t=>\t to force no widget ( => shell boxes)"
|
|
40
|
+
echo -e "\n"
|
|
41
|
+
echo -e "\tAnd [box types] -> [box options] are:"
|
|
42
|
+
echo -e "\t --question -> \"[text]\" \t\t=>\t ( 1 argument, box output to exit code and STDERR )"
|
|
43
|
+
echo -e "\t --message -> \"[text]\" \t\t\t=>\t ( 1 argument )"
|
|
44
|
+
echo -e "\t --alert_message -> \"[text]\" \t\t=>\t ( 1 argument )"
|
|
45
|
+
echo -e "\t --ok_message -> \"[text]\" \t\t=>\t ( 1 argument )"
|
|
46
|
+
echo -e "\t --text \t\t\t\t=>\t ( STDIN, NO argument, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
47
|
+
echo -e "\t --wait_seconds -> \"[integer]\" \t\t=>\t ( 1 argument )"
|
|
48
|
+
echo -e "\t --wait_for -> \"[text]\" \t\t=>\t ( 1 argument, PID to kill to \"wait_for__PID\" variable and STDERR )"
|
|
49
|
+
echo -e "\t --terminate_wait_for \t\t\t=>\t ( 1 argument only in $(basename "${0}" ), otherwise, NO argument )"
|
|
50
|
+
echo -e "\t --fselect -> \"<init. dir.>\" \t\t=>\t ( 1 <optional> argument, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
51
|
+
echo -e "\t --dselect -> \"<init. dir.>\" \t\t=>\t ( 1 <optional> argument, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
52
|
+
echo -e "\t --input -> 1 \"[init 1]\" \t\t=>\t ( 2 arguments, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
53
|
+
echo -e "\t --input -> 2 \"[label 1]\" \"[init 1]\" \"[label 2]\" \"[init 2]\" \t\t\t=> ( 5 arguments, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
54
|
+
echo -e "\t --input -> 3 \"[label 1]\" \"[init 1]\" \"[label 2]\" \"[init 2]\" \"[label 3]\" \"[init 3]\" => ( 7 arguments, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
55
|
+
echo -e "\t --menu -> \"[item 1]\" ... \"[item n]\" \t=>\t ( [n] arguments, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
56
|
+
echo -e "\t --list -> <+|->\"[item 1]\" ... <+|->\"[item n]\" \t=>\t ( [n] arguments, optionally prefixed with \"+\"(plus) or \"-\"(minus), box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
57
|
+
echo -e "\t --progress -> \"[text]\" \t\t\t=>\t ( STDIN -percent-, 1 argument )"
|
|
58
|
+
echo -e "\t --progress -> \"[text]\" \"[elements number]\" \t=>\t ( STDIN -\"PROGRESS\"-, 2 arguments )"
|
|
59
|
+
echo -e "\t --adjust -> \"[text]\" \"[min value]\" \"[init value]\" \"[max value]\" \t=>\t ( 4 arguments, box output to \"\${dir_tmp}/\${file_tmp}\" and STDERR )"
|
|
60
|
+
echo -e "\n\n"
|
|
61
|
+
echo -e "\t2)Examples:"
|
|
62
|
+
echo -e "\t>$(basename "${0}" ) -m a --question \"Do you like Contry music ?\" 2> a.txt ; a=\"\$(0< a.txt )\" ; rm -f a.txt ; [ \${a} -eq 0 ] && $(basename "${0}" ) -m a --ok_message \"You do like it :)\" || $(basename "${0}" ) -m a --alert_message \"You don't like it :(\" "
|
|
63
|
+
echo -e "\t>echo -e \"What's your name?\\\n\\\nMy name's:\\\nVittorio\" | $(basename "${0}" ) -m z --text"
|
|
64
|
+
echo -e "\t>$(basename "${0}" ) -m a --wait_seconds 3"
|
|
65
|
+
echo -e "\t>$(basename "${0}" ) -m k --wait_for \"I'm sleeping 4 seconds... good night...\" 2> pid.txt ; pid=\"\$(0< pid.txt )\" ; rm -f pid.txt ; sleep 4 ; $(basename "${0}" ) -m k --terminate_wait_for \"\${pid}\" "
|
|
66
|
+
echo -e "\t>$(basename "${0}" ) -m x --fselect"
|
|
67
|
+
echo -e "\t>$(basename "${0}" ) -m a --input 1 \"(write here IP address)\""
|
|
68
|
+
echo -e "\t>$(basename "${0}" ) -m k --input 3 \"Username\" \"root\" \"IP address\" \"192.168.0.1\" \"Destination directory\" \"/tmp\""
|
|
69
|
+
echo -e "\t>$(basename "${0}" ) -m d --menu \"Country\" \"Blues\" \"Rock\""
|
|
70
|
+
echo -e "\t>for i in 10 20 30 40 50 60 70 80 90 100 ; do echo \"\${i}\" && sleep 2 ; done | $(basename "${0}" ) -m d --progress \"This is a test progress...\""
|
|
71
|
+
echo -e "\t>for i in 10 20 30 40 50 60 70 80 90 100 ; do echo \"PROGRESS\" && sleep 2 ; done | $(basename "${0}" ) -m z --progress \"This is a test progress...\" \"10\""
|
|
72
|
+
echo -e "\n\n"
|
|
73
|
+
echo -e "\t3)Would you like *really* easy dialogs?"
|
|
74
|
+
echo -e "\tTry this:"
|
|
75
|
+
echo -e "\t>cp easybashgui /usr/local/bin/"
|
|
76
|
+
echo -e "\t>touch \"easy_updatedb.sh\""
|
|
77
|
+
echo -e "\t>chmod 755 \"easy_updatedb.sh\""
|
|
78
|
+
echo -e "\tThen, edit the file like so:"
|
|
79
|
+
echo -e "\t"
|
|
80
|
+
echo -e "\t#!/usr/bin/env bash"
|
|
81
|
+
echo -e "\tsource /usr/local/bin/easybashgui"
|
|
82
|
+
echo -e "\tmessage \"Click OK \\\n to update locate db...\""
|
|
83
|
+
echo -e "\twait_for \"Updating...\" ; updatedb ; terminate_wait_for"
|
|
84
|
+
echo -e "\tok_message \"Update finished ;-)\""
|
|
85
|
+
echo -e "\t"
|
|
86
|
+
echo -e "\tTry to launch the *same* script in console, in GNOME, in KDE, and finally in text console... ;-)"
|
|
87
|
+
echo
|
|
88
|
+
#
|
|
89
|
+
exit 1
|
|
90
|
+
#
|
|
91
|
+
} 1>&2
|
|
92
|
+
#
|
|
93
|
+
#
|
|
94
|
+
#
|
|
95
|
+
############################
|
|
96
|
+
#
|
|
97
|
+
#
|
|
98
|
+
#
|
|
99
|
+
[ ${#} -eq 0 ] && usage
|
|
100
|
+
while getopts ":hvm:" option
|
|
101
|
+
do
|
|
102
|
+
case ${option} in
|
|
103
|
+
"h" )
|
|
104
|
+
source easybashgui ; \
|
|
105
|
+
echo -e "\nThe library \"${LIB_NAME}\" allows bash scripters to simply provide their scripts a graphical user interface in an easy way: no matter wich dialog type is more appropriate ( if you are in GNOME, in KDE, etc.).\nThe script ( \"$(basename "${0}" )\" ) is used only to show ${LIB_NAME} library capability...\n\n" 1>&2 && usage \
|
|
106
|
+
;;
|
|
107
|
+
"v" )
|
|
108
|
+
source easybashgui ; \
|
|
109
|
+
echo -e "\n${LIB_NAME}: vers. ${LIB_VERSION}\n" 1>&2 && exit \
|
|
110
|
+
;;
|
|
111
|
+
"m" )
|
|
112
|
+
if [ "${OPTARG}" = "a" ]; then export supermode="auto" && break ; \
|
|
113
|
+
elif [ "${OPTARG}" = "g" ]; then export supermode="gtkdialog" && break ; \
|
|
114
|
+
elif [ "${OPTARG}" = "k" ]; then export supermode="kdialog" && break ; \
|
|
115
|
+
elif [ "${OPTARG}" = "z" ]; then export supermode="zenity" && break ; \
|
|
116
|
+
elif [ "${OPTARG}" = "x" ]; then export supermode="Xdialog" && break ; \
|
|
117
|
+
elif [ "${OPTARG}" = "d" ]; then export supermode="dialog" && break ; \
|
|
118
|
+
elif [ "${OPTARG}" = "n" ]; then export supermode="none" && break ; \
|
|
119
|
+
else usage ; \
|
|
120
|
+
fi \
|
|
121
|
+
;;
|
|
122
|
+
* )
|
|
123
|
+
usage \
|
|
124
|
+
;;
|
|
125
|
+
esac
|
|
126
|
+
#
|
|
127
|
+
done
|
|
128
|
+
shift $(($OPTIND - 1))
|
|
129
|
+
#
|
|
130
|
+
#
|
|
131
|
+
#
|
|
132
|
+
funct="$(echo "${1}" | tr -d '-' )"
|
|
133
|
+
case ${funct} in
|
|
134
|
+
"question"|\
|
|
135
|
+
"message"|"alert_message"|"ok_message"|\
|
|
136
|
+
"text"|\
|
|
137
|
+
"wait_seconds"|"wait_for"|"terminate_wait_for"|\
|
|
138
|
+
"fselect"|"dselect"|\
|
|
139
|
+
"input"|\
|
|
140
|
+
"menu"|"list"|\
|
|
141
|
+
"progress"|\
|
|
142
|
+
"adjust" )
|
|
143
|
+
:;;
|
|
144
|
+
|
|
145
|
+
* )
|
|
146
|
+
usage ;;
|
|
147
|
+
esac && shift
|
|
148
|
+
#
|
|
149
|
+
#
|
|
150
|
+
#
|
|
151
|
+
############################
|
|
152
|
+
# ...main
|
|
153
|
+
LIB_CHECK="$(type "easybashgui" 2> /dev/null )" ; [ ${#LIB_CHECK} -eq 0 ] && echo -e "\n\n\n\nYou need to copy \"easybashgui\" in your path ( e.g.: \"cp easybashgui_X.X.X /usr/local/bin/\" )...\n:(\n\n\n\n" 1>&2 && usage
|
|
154
|
+
#
|
|
155
|
+
source easybashgui
|
|
156
|
+
num_param=${#}
|
|
157
|
+
eval ${funct} $(for (( index=1 ; index <= ${num_param} ; index++ ))
|
|
158
|
+
do
|
|
159
|
+
echo -n "\"${1}\" "
|
|
160
|
+
shift
|
|
161
|
+
done )
|
|
162
|
+
clean_temp
|
|
163
|
+
# bye! ;-)
|
package/scripts/mom.sh
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
function main() {
|
|
3
|
+
config
|
|
4
|
+
|
|
5
|
+
# root
|
|
6
|
+
root=$(cat /usr/lib/penguins-eggs/.oclif.manifest.json | jq .)
|
|
7
|
+
result=$(echo ${root} | jq ".commands[].id")
|
|
8
|
+
result+=("quit")
|
|
9
|
+
|
|
10
|
+
while true; do
|
|
11
|
+
clear
|
|
12
|
+
# NOTE [@]
|
|
13
|
+
menu ${result[@]}
|
|
14
|
+
answer=$(0< "${dir_tmp}/${file_tmp}" )
|
|
15
|
+
case "$answer" in
|
|
16
|
+
quit)
|
|
17
|
+
exit ;;
|
|
18
|
+
*)
|
|
19
|
+
eggs $answer --help
|
|
20
|
+
press_a_key_to_continue
|
|
21
|
+
esac
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
exit 0
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
################################
|
|
28
|
+
function query() {
|
|
29
|
+
local retval=$(echo ${root} | jq "${filter}")
|
|
30
|
+
echo ${retval}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
################################
|
|
34
|
+
function config() {
|
|
35
|
+
# configurations
|
|
36
|
+
set -e
|
|
37
|
+
|
|
38
|
+
# Disable unicode.
|
|
39
|
+
LC_ALL=C
|
|
40
|
+
LANG=C
|
|
41
|
+
|
|
42
|
+
# easy-bash-gui
|
|
43
|
+
MSP=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
44
|
+
source ${MSP}/includes/easybashgui
|
|
45
|
+
source ${MSP}/includes/easybashgui.lib
|
|
46
|
+
source ${MSP}/includes/common.sh
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
################################
|
|
50
|
+
function press_a_key_to_continue {
|
|
51
|
+
read -rp "Press enter to continue"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
main
|
|
55
|
+
|
|
56
|
+
# EOF()
|
|
File without changes
|