├── LICENSE.md
├── README.md
├── desktop
├── cylondeb.desktop
└── cylondebicon.png
├── documentation
└── changelog.md
├── main
└── cylondeb
├── makefile
├── modules
├── MaintenanceModule
├── MiscModule
├── SystemCleanModule
└── SystemMaintModule
└── screenshots
├── bleachbit_CLI_wrapper.png
├── main_menu.png
├── main_three.png
├── menu_one.png
└── menu_two.png
/LICENSE.md:
--------------------------------------------------------------------------------
1 |
2 | GNU GENERAL PUBLIC LICENSE
3 | Version 3, 29 June 2007
4 |
5 | Copyright (C) 2007 Free Software Foundation, Inc.
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The GNU General Public License is a free, copyleft license for
12 | software and other kinds of works.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | the GNU General Public License is intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users. We, the Free Software Foundation, use the
19 | GNU General Public License for most of our software; it applies also to
20 | any other work released this way by its authors. You can apply it to
21 | your programs, too.
22 |
23 | When we speak of free software, we are referring to freedom, not
24 | price. Our General Public Licenses are designed to make sure that you
25 | have the freedom to distribute copies of free software (and charge for
26 | them if you wish), that you receive source code or can get it if you
27 | want it, that you can change the software or use pieces of it in new
28 | free programs, and that you know you can do these things.
29 |
30 | To protect your rights, we need to prevent others from denying you
31 | these rights or asking you to surrender the rights. Therefore, you have
32 | certain responsibilities if you distribute copies of the software, or if
33 | you modify it: responsibilities to respect the freedom of others.
34 |
35 |
36 | TERMS AND CONDITIONS
37 |
38 | 0. Definitions.
39 |
40 | "This License" refers to version 3 of the GNU General Public License.
41 |
42 | "Copyright" also means copyright-like laws that apply to other kinds of
43 | works, such as semiconductor masks.
44 |
45 | "The Program" refers to any copyrightable work licensed under this
46 | License. Each licensee is addressed as "you". "Licensees" and
47 | "recipients" may be individuals or organizations.
48 |
49 | To "modify" a work means to copy from or adapt all or part of the work
50 | in a fashion requiring copyright permission, other than the making of an
51 | exact copy. The resulting work is called a "modified version" of the
52 | earlier work or a work "based on" the earlier work.
53 |
54 | A "covered work" means either the unmodified Program or a work based
55 | on the Program.
56 |
57 | To "propagate" a work means to do anything with it that, without
58 | permission, would make you directly or secondarily liable for
59 | infringement under applicable copyright law, except executing it on a
60 | computer or modifying a private copy. Propagation includes copying,
61 | distribution (with or without modification), making available to the
62 | public, and in some countries other activities as well.
63 |
64 | To "convey" a work means any kind of propagation that enables other
65 | parties to make or receive copies. Mere interaction with a user through
66 | a computer network, with no transfer of a copy, is not conveying.
67 |
68 | An interactive user interface displays "Appropriate Legal Notices"
69 | to the extent that it includes a convenient and prominently visible
70 | feature that (1) displays an appropriate copyright notice, and (2)
71 | tells the user that there is no warranty for the work (except to the
72 | extent that warranties are provided), that licensees may convey the
73 | work under this License, and how to view a copy of this License. If
74 | the interface presents a list of user commands or options, such as a
75 | menu, a prominent item in the list meets this criterion.
76 |
77 | 1. Source Code.
78 |
79 | The "source code" for a work means the preferred form of the work
80 | for making modifications to it. "Object code" means any non-source
81 | form of a work.
82 |
83 | A "Standard Interface" means an interface that either is an official
84 | standard defined by a recognized standards body, or, in the case of
85 | interfaces specified for a particular programming language, one that
86 | is widely used among developers working in that language.
87 |
88 | The "System Libraries" of an executable work include anything, other
89 | than the work as a whole, that (a) is included in the normal form of
90 | packaging a Major Component, but which is not part of that Major
91 | Component, and (b) serves only to enable use of the work with that
92 | Major Component, or to implement a Standard Interface for which an
93 | implementation is available to the public in source code form. A
94 | "Major Component", in this context, means a major essential component
95 | (kernel, window system, and so on) of the specific operating system
96 | (if any) on which the executable work runs, or a compiler used to
97 | produce the work, or an object code interpreter used to run it.
98 |
99 | The Corresponding Source need not include anything that users
100 | can regenerate automatically from other parts of the Corresponding
101 | Source.
102 |
103 | The Corresponding Source for a work in source code form is that
104 | same work.
105 |
106 | 2. Basic Permissions.
107 |
108 | All rights granted under this License are granted for the term of
109 | copyright on the Program, and are irrevocable provided the stated
110 | conditions are met. This License explicitly affirms your unlimited
111 | permission to run the unmodified Program. The output from running a
112 | covered work is covered by this License only if the output, given its
113 | content, constitutes a covered work. This License acknowledges your
114 | rights of fair use or other equivalent, as provided by copyright law.
115 |
116 | You may make, run and propagate covered works that you do not
117 | convey, without conditions so long as your license otherwise remains
118 | in force. You may convey covered works to others for the sole purpose
119 | of having them make modifications exclusively for you, or provide you
120 | with facilities for running those works, provided that you comply with
121 | the terms of this License in conveying all material for which you do
122 | not control copyright. Those thus making or running the covered works
123 | for you must do so exclusively on your behalf, under your direction
124 | and control, on terms that prohibit them from making any copies of
125 | your copyrighted material outside their relationship with you.
126 |
127 | Conveying under any other circumstances is permitted solely under
128 | the conditions stated below. Sublicensing is not allowed; section 10
129 | makes it unnecessary.
130 |
131 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
132 |
133 | No covered work shall be deemed part of an effective technological
134 | measure under any applicable law fulfilling obligations under article
135 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
136 | similar laws prohibiting or restricting circumvention of such
137 | measures.
138 |
139 | 4. Conveying Verbatim Copies.
140 |
141 | You may convey verbatim copies of the Program's source code as you
142 | receive it, in any medium, provided that you conspicuously and
143 | appropriately publish on each copy an appropriate copyright notice;
144 | keep intact all notices stating that this License and any
145 | non-permissive terms added in accord with section 7 apply to the code;
146 | keep intact all notices of the absence of any warranty; and give all
147 | recipients a copy of this License along with the Program.
148 |
149 | You may charge any price or no price for each copy that you convey,
150 | and you may offer support or warranty protection for a fee.
151 |
152 | 5. Conveying Modified Source Versions.
153 |
154 | You may convey a work based on the Program, or the modifications to
155 | produce it from the Program, in the form of source code under the
156 | terms of section 4, provided that you also meet all of these conditions:
157 |
158 | a) The work must carry prominent notices stating that you modified
159 | it, and giving a relevant date.
160 |
161 | b) The work must carry prominent notices stating that it is
162 | released under this License and any conditions added under section
163 | 7. This requirement modifies the requirement in section 4 to
164 | "keep intact all notices".
165 |
166 | c) You must license the entire work, as a whole, under this
167 | License to anyone who comes into possession of a copy. This
168 | License will therefore apply, along with any applicable section 7
169 | additional terms, to the whole of the work, and all its parts,
170 | regardless of how they are packaged. This License gives no
171 | permission to license the work in any other way, but it does not
172 | invalidate such permission if you have separately received it.
173 |
174 | d) If the work has interactive user interfaces, each must display
175 | Appropriate Legal Notices; however, if the Program has interactive
176 | interfaces that do not display Appropriate Legal Notices, your
177 | work need not make them do so.
178 |
179 | 6. Conveying Non-Source Forms.
180 |
181 | You may convey a covered work in object code form under the terms
182 | of sections 4 and 5, provided that you also convey the
183 | machine-readable Corresponding Source under the terms of this License,
184 | in one of these ways:
185 |
186 | a) Convey the object code in, or embodied in, a physical product
187 | (including a physical distribution medium), accompanied by the
188 | Corresponding Source fixed on a durable physical medium
189 | customarily used for software interchange.
190 |
191 | b) Convey the object code in, or embodied in, a physical product
192 | (including a physical distribution medium), accompanied by a
193 | written offer, valid for at least three years and valid for as
194 | long as you offer spare parts or customer support for that product
195 | model, to give anyone who possesses the object code either (1) a
196 | copy of the Corresponding Source for all the software in the
197 | product that is covered by this License, on a durable physical
198 | medium customarily used for software interchange, for a price no
199 | more than your reasonable cost of physically performing this
200 | conveying of source, or (2) access to copy the
201 | Corresponding Source from a network server at no charge.
202 |
203 | c) Convey individual copies of the object code with a copy of the
204 | written offer to provide the Corresponding Source. This
205 | alternative is allowed only occasionally and noncommercially, and
206 | only if you received the object code with such an offer, in accord
207 | with subsection 6b.
208 |
209 | d) Convey the object code by offering access from a designated
210 | place (gratis or for a charge), and offer equivalent access to the
211 | Corresponding Source in the same way through the same place at no
212 | further charge. You need not require recipients to copy the
213 | Corresponding Source along with the object code. If the place to
214 | copy the object code is a network server, the Corresponding Source
215 | may be on a different server (operated by you or a third party)
216 | that supports equivalent copying facilities, provided you maintain
217 | clear directions next to the object code saying where to find the
218 | Corresponding Source. Regardless of what server hosts the
219 | Corresponding Source, you remain obligated to ensure that it is
220 | available for as long as needed to satisfy these requirements.
221 |
222 | e) Convey the object code using peer-to-peer transmission, provided
223 | you inform other peers where the object code and Corresponding
224 | Source of the work are being offered to the general public at no
225 | charge under subsection 6d.
226 |
227 | A "User Product" is either (1) a "consumer product", which means any
228 | tangible personal property which is normally used for personal, family,
229 | or household purposes, or (2) anything designed or sold for incorporation
230 | into a dwelling. In determining whether a product is a consumer product,
231 | doubtful cases shall be resolved in favor of coverage. For a particular
232 | product received by a particular user, "normally used" refers to a
233 | typical or common use of that class of product, regardless of the status
234 | of the particular user or of the way in which the particular user
235 | actually uses, or expects or is expected to use, the product. A product
236 | is a consumer product regardless of whether the product has substantial
237 | commercial, industrial or non-consumer uses, unless such uses represent
238 | the only significant mode of use of the product.
239 |
240 | "Installation Information" for a User Product means any methods,
241 | procedures, authorization keys, or other information required to install
242 | and execute modified versions of a covered work in that User Product from
243 | a modified version of its Corresponding Source. The information must
244 | suffice to ensure that the continued functioning of the modified object
245 | code is in no case prevented or interfered with solely because
246 | modification has been made.
247 |
248 | If you convey an object code work under this section in, or with, or
249 | specifically for use in, a User Product, and the conveying occurs as
250 | part of a transaction in which the right of possession and use of the
251 | User Product is transferred to the recipient in perpetuity or for a
252 | fixed term (regardless of how the transaction is characterized), the
253 | Corresponding Source conveyed under this section must be accompanied
254 | by the Installation Information. But this requirement does not apply
255 | if neither you nor any third party retains the ability to install
256 | modified object code on the User Product (for example, the work has
257 | been installed in ROM).
258 |
259 | Corresponding Source conveyed, and Installation Information provided,
260 | in accord with this section must be in a format that is publicly
261 | documented (and with an implementation available to the public in
262 | source code form), and must require no special password or key for
263 | unpacking, reading or copying.
264 |
265 | 7. Additional Terms.
266 |
267 | "Additional permissions" are terms that supplement the terms of this
268 | License by making exceptions from one or more of its conditions.
269 | Additional permissions that are applicable to the entire Program shall
270 | be treated as though they were included in this License, to the extent
271 | that they are valid under applicable law. If additional permissions
272 | apply only to part of the Program, that part may be used separately
273 | under those permissions, but the entire Program remains governed by
274 | this License without regard to the additional permissions.
275 |
276 | Notwithstanding any other provision of this License, for material you
277 | add to a covered work, you may (if authorized by the copyright holders of
278 | that material) supplement the terms of this License with terms:
279 |
280 | a) Disclaiming warranty or limiting liability differently from the
281 | terms of sections 15 and 16 of this License; or
282 |
283 | b) Requiring preservation of specified reasonable legal notices or
284 | author attributions in that material or in the Appropriate Legal
285 | Notices displayed by works containing it; or
286 |
287 | c) Prohibiting misrepresentation of the origin of that material, or
288 | requiring that modified versions of such material be marked in
289 | reasonable ways as different from the original version; or
290 |
291 | d) Limiting the use for publicity purposes of names of licensors or
292 | authors of the material; or
293 |
294 | e) Declining to grant rights under trademark law for use of some
295 | trade names, trademarks, or service marks; or
296 |
297 | f) Requiring indemnification of licensors and authors of that
298 | material by anyone who conveys the material (or modified versions of
299 | it) with contractual assumptions of liability to the recipient, for
300 | any liability that these contractual assumptions directly impose on
301 | those licensors and authors.
302 |
303 | All other non-permissive additional terms are considered "further
304 | restrictions" within the meaning of section 10. If the Program as you
305 | received it, or any part of it, contains a notice stating that it is
306 | governed by this License along with a term that is a further
307 | restriction, you may remove that term. If a license document contains
308 | a further restriction but permits relicensing or conveying under this
309 | License, you may add to a covered work material governed by the terms
310 | of that license document, provided that the further restriction does
311 | not survive such relicensing or conveying.
312 |
313 | Additional terms, permissive or non-permissive, may be stated in the
314 | form of a separately written license, or stated as exceptions;
315 | the above requirements apply either way.
316 |
317 | 8. Termination.
318 |
319 | You may not propagate or modify a covered work except as expressly
320 | provided under this License. Any attempt otherwise to propagate or
321 | modify it is void, and will automatically terminate your rights under
322 | this License (including any patent licenses granted under the third
323 | paragraph of section 11).
324 |
325 |
326 | Moreover, your license from a particular copyright holder is
327 | reinstated permanently if the copyright holder notifies you of the
328 | violation by some reasonable means, this is the first time you have
329 | received notice of violation of this License (for any work) from that
330 | copyright holder, and you cure the violation prior to 30 days after
331 | your receipt of the notice.
332 |
333 | Termination of your rights under this section does not terminate the
334 | licenses of parties who have received copies or rights from you under
335 | this License. If your rights have been terminated and not permanently
336 | reinstated, you do not qualify to receive new licenses for the same
337 | material under section 10.
338 |
339 | 9. Acceptance Not Required for Having Copies.
340 |
341 | You are not required to accept this License in order to receive or
342 | run a copy of the Program. Ancillary propagation of a covered work
343 | occurring solely as a consequence of using peer-to-peer transmission
344 | to receive a copy likewise does not require acceptance. However,
345 | nothing other than this License grants you permission to propagate or
346 | modify any covered work. These actions infringe copyright if you do
347 | not accept this License. Therefore, by modifying or propagating a
348 | covered work, you indicate your acceptance of this License to do so.
349 |
350 | 10. Automatic Licensing of Downstream Recipients.
351 |
352 | Each time you convey a covered work, the recipient automatically
353 | receives a license from the original licensors, to run, modify and
354 | propagate that work, subject to this License. You are not responsible
355 | for enforcing compliance by third parties with this License.
356 |
357 | An "entity transaction" is a transaction transferring control of an
358 | organization, or substantially all assets of one, or subdividing an
359 | organization, or merging organizations. If propagation of a covered
360 | work results from an entity transaction, each party to that
361 | transaction who receives a copy of the work also receives whatever
362 | licenses to the work the party's predecessor in interest had or could
363 | give under the previous paragraph, plus a right to possession of the
364 | Corresponding Source of the work from the predecessor in interest, if
365 | the predecessor has it or can get it with reasonable efforts.
366 |
367 | 11. Patents.
368 |
369 | A "contributor" is a copyright holder who authorizes use under this
370 | License of the Program or a work on which the Program is based. The
371 | work thus licensed is called the contributor's "contributor version".
372 |
373 | A contributor's "essential patent claims" are all patent claims
374 | owned or controlled by the contributor, whether already acquired or
375 | hereafter acquired, that would be infringed by some manner, permitted
376 | by this License, of making, using, or selling its contributor version,
377 | but do not include claims that would be infringed only as a
378 | consequence of further modification of the contributor version. For
379 | purposes of this definition, "control" includes the right to grant
380 | patent sublicenses in a manner consistent with the requirements of
381 | this License.
382 |
383 | Each contributor grants you a non-exclusive, worldwide, royalty-free
384 | patent license under the contributor's essential patent claims, to
385 | make, use, sell, offer for sale, import and otherwise run, modify and
386 | propagate the contents of its contributor version.
387 |
388 | In the following three paragraphs, a "patent license" is any express
389 | agreement or commitment, however denominated, not to enforce a patent
390 | (such as an express permission to practice a patent or covenant not to
391 | sue for patent infringement). To "grant" such a patent license to a
392 | party means to make such an agreement or commitment not to enforce a
393 | patent against the party.
394 |
395 | If, pursuant to or in connection with a single transaction or
396 | arrangement, you convey, or propagate by procuring conveyance of, a
397 | covered work, and grant a patent license to some of the parties
398 | receiving the covered work authorizing them to use, propagate, modify
399 | or convey a specific copy of the covered work, then the patent license
400 | you grant is automatically extended to all recipients of the covered
401 | work and works based on it.
402 |
403 | A patent license is "discriminatory" if it does not include within
404 | the scope of its coverage, prohibits the exercise of, or is
405 | conditioned on the non-exercise of one or more of the rights that are
406 | specifically granted under this License. You may not convey a covered
407 | work if you are a party to an arrangement with a third party that is
408 | in the business of distributing software, under which you make payment
409 | to the third party based on the extent of your activity of conveying
410 | the work, and under which the third party grants, to any of the
411 | parties who would receive the covered work from you, a discriminatory
412 | patent license (a) in connection with copies of the covered work
413 | conveyed by you (or copies made from those copies), or (b) primarily
414 | for and in connection with specific products or compilations that
415 | contain the covered work, unless you entered into that arrangement,
416 | or that patent license was granted, prior to 28 March 2007.
417 |
418 | 12. No Surrender of Others' Freedom.
419 |
420 | If conditions are imposed on you (whether by court order, agreement or
421 | otherwise) that contradict the conditions of this License, they do not
422 | excuse you from the conditions of this License. If you cannot convey a
423 | covered work so as to satisfy simultaneously your obligations under this
424 | License and any other pertinent obligations, then as a consequence you may
425 | not convey it at all. For example, if you agree to terms that obligate you
426 | to collect a royalty for further conveying from those to whom you convey
427 | the Program, the only way you could satisfy both those terms and this
428 | License would be to refrain entirely from conveying the Program.
429 |
430 | 13. Use with the GNU Affero General Public License.
431 |
432 | Notwithstanding any other provision of this License, you have
433 | permission to link or combine any covered work with a work licensed
434 | under version 3 of the GNU Affero General Public License into a single
435 | combined work, and to convey the resulting work. The terms of this
436 | License will continue to apply to the part which is the covered work,
437 | but the special requirements of the GNU Affero General Public License,
438 | section 13, concerning interaction through a network will apply to the
439 | combination as such.
440 |
441 | 14. Revised Versions of this License.
442 |
443 | The Free Software Foundation may publish revised and/or new versions of
444 | the GNU General Public License from time to time. Such new versions will
445 | be similar in spirit to the present version, but may differ in detail to
446 | address new problems or concerns.
447 |
448 | Each version is given a distinguishing version number. If the
449 | Program specifies that a certain numbered version of the GNU General
450 | Public License "or any later version" applies to it, you have the
451 | option of following the terms and conditions either of that numbered
452 | version or of any later version published by the Free Software
453 | Foundation. If the Program does not specify a version number of the
454 | GNU General Public License, you may choose any version ever published
455 | by the Free Software Foundation.
456 |
457 | Later license versions may give you additional or different
458 | permissions. However, no additional obligations are imposed on any
459 | author or copyright holder as a result of your choosing to follow a
460 | later version.
461 |
462 | 15. Disclaimer of Warranty.
463 |
464 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
465 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
466 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
467 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
468 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
469 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
470 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
471 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
472 |
473 | 16. Limitation of Liability.
474 |
475 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
476 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
477 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
478 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
479 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
480 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
481 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
482 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
483 | SUCH DAMAGES.
484 |
485 | 17. Interpretation of Sections 15 and 16.
486 |
487 | If the disclaimer of warranty and limitation of liability provided
488 | above cannot be given local legal effect according to their terms,
489 | reviewing courts shall apply local law that most closely approximates
490 | an absolute waiver of all civil liability in connection with the
491 | Program, unless a warranty or assumption of liability accompanies a
492 | copy of the Program in return for a fee.
493 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://www.paypal.com/paypalme/whitelight976)
2 |
3 | Overview
4 | --------------------------------------------
5 | * Title : cylon-deb , Debian based Linux distribution maintenance program.
6 | * Description:
7 | A TUI (terminal user interface) which allows users to
8 | carry out maintenance on an Debian based linux distributions.
9 | The program is menu-based and written in bash.
10 | The program is a fork and highly truncated version of the
11 | arch-linux maintenance program *cylon*,
12 | which can also be found in this repo. This program provides a
13 | Terminal based alternative to GUI software managers found in many distros.
14 |
15 | * Author: [Gavin Lyons](https://gavinlyonsrepo.github.io/)
16 |
17 | Table of contents
18 | ---------------------------
19 |
20 | * [Overview](#overview)
21 | * [Table of contents](#table-of-contents)
22 | * [Installation](#installation)
23 | * [Usage](#usage)
24 | * [Files](#files)
25 | * [Output and environment variables](#output-and-environment-variables)
26 | * [Dependencies](#dependencies)
27 | * [Features](#features)
28 | * [Package Lists](#package-lists)
29 | * [See Also](#see-also)
30 |
31 |
32 | Installation
33 | -----------------------------------------------
34 |
35 | Two different install methods.
36 |
37 | 1. Install by PPA (Distros based on Ubuntu 22.04 LTS )
38 |
39 | A Personal Package Archives (PPA) has been created on Ubuntu
40 | package building and hosting section of launchpad site
41 | called cylondeb. Package built only for on Ubuntu 22.04 LTS (Jammy JellyFish) 64bit To install this on your system run commands in terminal
42 |
43 | ```sh
44 | sudo add-apt-repository ppa:typematrix/cylondeb
45 | sudo apt update
46 | sudo apt install cylondeb
47 | ```
48 |
49 | **OR**
50 |
51 | 2. Install by makefile
52 |
53 | Download latest fixed release and run the makefile as per
54 | terminal commands below for version 2.4 latest release at time of writing.
55 | You will not be informed of updates by system if you use this method.
56 |
57 | ```sh
58 | curl -sL https://github.com/gavinlyonsrepo/cylon-deb/archive/2.4.tar.gz | tar xz
59 | cd cylon-deb-2.4
60 | sudo make install
61 | ```
62 |
63 | Usage
64 | -------------------------------------------
65 |
66 | Run in a terminal by typing:
67 |
68 | cylondeb -[options]
69 |
70 | Options list (standalone cannot be combined):
71 |
72 | | Option | Description |
73 | | --------------- | --------------- |
74 | | -h --help | Print cylondeb information and exit |
75 | | -s --system | Print system information and exit |
76 | | -v --version | Print version information and exit |
77 | | -p --print | Print the package lists |
78 | | -b --bleachbit | Shortcut to opens the bleachbit select menus |
79 |
80 | Files
81 | -----------------------------------------
82 |
83 | | File | Description |
84 | | ------ | ------ |
85 | | /usr/bin/cylondeb | The main shell script |
86 | | /usr/lib/cylondeb/modules/* | Module files containing functions |
87 | | /usr/share/doc/cylondeb/README.md | Help file |
88 | | /usr/share/doc/copyright | copyright file |
89 | | /usr/share/pixmaps/cylondebicon.png | program icon |
90 | | /usr/share/applications/cylondeb.desktop | desktop entry file |
91 |
92 | Output and environment variables
93 | -------------------------------------
94 |
95 | CYLONDEST is an optional custom environmental variable
96 | used by program. If variable CYLONDEST is not set or does not exist,
97 | cylon uses the default path.
98 | Most system output (logfiles, downloads and updates etc)
99 | is placed at below path, unless otherwise specified on screen.
100 | Output folders are created with following time/date stamp syntax HHMM-DDMONYY-X
101 | where X is output type i.e download, update etc. The default path is:
102 |
103 | ```sh
104 | $HOME/Documents/cylondeb
105 | ```
106 |
107 | Optional Dependencies
108 | -------------------------------------
109 | Some functions require dependencies packages to be installed.
110 | These optional dependencies are left to user discretion.
111 | The user can check if optional dependencies installed with cylondeb help.
112 |
113 | | Dependencies| Usage |
114 | | ------ | ------ |
115 | | aptitude | High-level interface to the package manager APT |
116 | | deborphan | Orphaned package finder |
117 | | debsums | Verify the integrity of installed package files |
118 | | ppa-purge | Disables a PPA and reverts to official packages |
119 | | bleachbit | System clean and shredding |
120 |
121 | Features
122 | ----------------------
123 |
124 | The features are split into two main sections.
125 |
126 | Section one deals with system maintenance. The options here are divided
127 | into 3 menus. Menu one deals with routine package maintenance
128 | upgrading, installing, searching etc. Menu two deals with more advanced
129 | options such as removing obsolete and orphaned packages, Exercise care
130 | and make backups and copys of the "packagelists" before using these options.
131 | Menu 3 deals has some general linux maintenance options as well as a
132 | CLI wrapper for bleachbit. BleachBit is a free and open-source disk space
133 | cleaner, privacy manager, and computer system optimizer.
134 |
135 | Section 2 is the miscellaneous section it mainly contains cylon and
136 | system information displays.
137 |
138 | **1: System update section**
139 | * Menu one options
140 | * Check for updates (no download), aptitude search '~U'
141 | * Upgrade all, apt update && apt dist-upgrade
142 | * Display remote package information, apt-cache show
143 | * Install Package, apt install
144 | * Delete Package, apt remove
145 | * Search for packages in the database, apt search
146 | * Search for already installed packages, aptitude search '~i'
147 | * Display info for locally installed packages, dpkg -s
148 | * List all files owned by a given package, dpkg -L
149 | * Write installed package lists to files (see package list section)
150 | * View dpkg log file at /var/log/dpkg.log
151 | * Show all or most information about a package, apt show
152 | * Show the changelog of a package, apt-get changelog
153 | * Verify all packages, debsums
154 | * Verify dependencies of the complete system, apt-get check
155 | * Add a PPA to system, add-apt-repository ppa:
156 | * Purge a PPA from system, ppa-purge
157 |
158 | *Warning*
159 |
160 | Some of these options in menu 2 remove unwanted and unneeded packages
161 | and configs from system as identified by utilities. What will be
162 | removed is presented to user first. Please take care especially with
163 | deborphan options numbered 3 <-> 6.
164 | These have not been tested on all debian type distros.
165 | Options 3 to 6 should only be used with caution by advanced users.
166 |
167 | * Menu two options
168 | * Clean up all local cache, apt autoclean
169 | * Removes pkgs installed by other pkgs & no longer needed, apt autoremove
170 | * Remove pkg's no longer included in any repos, aptitude purge '~o'
171 | * Remove orphan packages with orphaner tool
172 | * Remove orphaned packages automatically,
173 | sudo deborphan | xargs sudo apt-get -y remove --purge
174 | * Removing packages and configurations which are not required
175 | by any other package upon your system, deborphan -n --find-config
176 | | xargs apt-get -y purge
177 | * delete contents of CYLONDEST output folder
178 |
179 | * Menu 3 options
180 | * All Failed Systemd Services and system status
181 | * All Failed Active Systemd Services
182 | * Check log Journalctl for Errors
183 | * Check log Journalctl for fstrim SSD trim (check for SSD in system)
184 | * Analyze system boot-up performance
185 | * Check for broken symlinks
186 | * Check for files not owned by any user or group
187 | * Diskspace usage
188 | * Old configuration files scan, output to files
189 | * Find system inode usage
190 | * Find largest files
191 | * Print sensors information
192 | * Vacuum journal files
193 | * Delete core dumps
194 | * delete files
195 | * Shred specific files with bleachbit
196 | * Shred specific folders with bleachbit
197 | * Clean system with bleachbit (also run by -b standalone option.)
198 | * Preset option based on the same options as in the GUI
199 | * Custom options involved for user to pick cleaners and options
200 | * preview
201 | * clean (without overwrite, BB checks the config in GUI).
202 | * clean + overwrite (with overwrite permanent deletion)
203 | * List all open files
204 |
205 | **2: Miscellaneous section**
206 | * Option to open xterm terminal at output folder path in new window
207 |
208 | * Computer system information display
209 | * Displays detailed information on system and package setup
210 | * Function also run by -s standalone option.
211 |
212 | * Cylon information:
213 | * Dependencies installation check, info and display readme file to screen
214 | * Function can also run by option -h
215 |
216 |
217 | Package Lists
218 | ---------------
219 |
220 | | Index | Contents | Filename |
221 | | -------- | -------- | ----- |
222 | | 1 | All installed | All_PKG |
223 | | 2 | All native, explicitly installed | Exp_PKG |
224 | | 3 | List orphaned packages | noinstall_PKG |
225 | | 4 | Get a dump of the whole system information | stats_PKG |
226 | | 5 | List packages that were recently added to one of the installation sources | Recent_add_PKG |
227 | | 6 | List packages not required by any other package | non-Dep_PKG |
228 | | 7 | List packages installed automatically (as dependencies) | auto_Dep_PKG |
229 | | 8 | Prints a list of all installation source | Info_Source_PKG|
230 | | 9 | List of non-standard repositories in use | non_standard_PKG |
231 | | 10 | List Installed packages by size | install_size_PKG |
232 | | 11 | List packages by install date | Install_date_1_PKG |
233 | | 12 | List packages by install date less data | Install_date_2_PKG |
234 |
235 |
236 | ### Commands used by index number in table:
237 |
238 | 1. dpkg --list | grep "^i"
239 | 2. apt-mark showmanual
240 | 3. deborphan
241 | 4. apt-cache stats
242 | 5. aptitude search '~N'
243 | 6. deborphan -anp1
244 | 7. apt-mark showauto
245 | 8. apt-cache policy
246 | 9. cat /etc/apt/sources.list.d/*.list | grep -v "^#"
247 | 10. aptitude search "~i" --display-format "%p %I" --sort installsize
248 | 11. grep installed /var/log/dpkg.log
249 | 12. grep " install " /var/log/dpkg.log
250 |
251 |
252 | See Also
253 | ------------------
254 |
255 | * [aptitude](https://www.debian.org/doc/manuals/aptitude/)
256 | * [apt](https://help.ubuntu.com/lts/serverguide/apt.html)
257 | * [dpkg](http://manpages.ubuntu.com/manpages/zesty/en/man1/dpkg.1.html)
258 | * [deborphan](https://www.commandlinux.com/man-page/man1/deborphan.1.html)
259 | * [debsums](http://manpages.ubuntu.com/manpages/trusty/man1/debsums.1.html)
260 | * [ppa-purge](http://manpages.ubuntu.com/manpages/precise/en/man1/ppa-purge.1.html)
261 | * [bleachbit](https://en.wikipedia.org/wiki/BleachBit)
262 |
--------------------------------------------------------------------------------
/desktop/cylondeb.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=cylondeb
3 | GenericName=cylondeb maintenance
4 | Comment=Linux maintenance CLI program for Debian based distro
5 | Exec=cylondeb
6 | Icon=cylondebicon
7 | Categories=System
8 | Type=Application
9 | Terminal=true
10 |
--------------------------------------------------------------------------------
/desktop/cylondebicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/desktop/cylondebicon.png
--------------------------------------------------------------------------------
/documentation/changelog.md:
--------------------------------------------------------------------------------
1 |
2 | Version control
3 | ---------------------------
4 |
5 | * version 1.0-1 301117
6 | * Forked from gavinlyonsrepo/cylon
7 | * converted from Arch based program to Debian based program.
8 |
9 | * version 1.1-2 091217
10 | * Truncated to update menu only.
11 |
12 | * version 1.4-3 121217
13 | * Added PPA on launchpad
14 |
15 | * version 2.0-1 291217
16 | * Increased update options from 13 to 20.
17 | * Increased Package list from 3 to 12 lists
18 | * Added more information to system and cylon information screens.
19 |
20 | * version 2.1-2 270118
21 | * 19 new maintenance options added.
22 | * bleachbit CLI wrapper added.
23 | * Maintenance options divided into 3 menus.
24 |
25 | * version 2.2-3 050718
26 | * updating PPA to Ubuntu 18.04 LTS (Bionic Beaver)
27 |
28 | * version 2.3-4 200520
29 | * updating PPA to Ubuntu 20.04 LTS (Focal Fossa)
30 |
31 | * version 2.4-5 22-04-2022
32 | * updating PPA to Ubuntu 22.04 LTS (Jammy JellyFish)
33 |
--------------------------------------------------------------------------------
/main/cylondeb:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #==HEADER==
3 | #Name:cylon-deb
4 | #Written by Gavin lyons
5 | #Software repo: https://github.com/gavinlyonsrepo/cylon_deb
6 |
7 | #==GLOBAL VARIABLES SETUP==
8 |
9 | #colours for printf
10 | RED=$(printf "\033[31;1m")
11 | GREEN=$(printf "\033[32;1m")
12 | YELLOW=$(printf "\033[33;1m")
13 | BLUE=$(printf "\033[36;1m")
14 | HL=$(printf "\033[42;1m")
15 | NORMAL=$(printf "\033[0m")
16 |
17 | #prompt for select menus
18 | PS3="${BLUE}By your command:${NORMAL}"
19 |
20 | #set the path for the program output path DEST3
21 | #if environmental variable CYLONDEST exists set it to DEST3
22 | #and make the path for dest3
23 | if [ -z "${CYLONDEST}" ]
24 | then
25 | #default path for program output
26 | DEST3="$HOME/Documents/cylondeb/"
27 | else
28 | DEST3="$CYLONDEST"
29 | fi
30 | mkdir -p "$DEST3"
31 |
32 | DEST6="/usr/share/doc/cylondeb/" # readme
33 | DEST7="/usr/lib/cylondeb/modules/" #lib modules
34 | #DEST7="../modules/" # Development path comment out for production
35 |
36 | #==FUNCTIONS==
37 | #Source the module files for the functions from the cylon library folder
38 | #at /usr/lib/cylon/modules/* , Function syntax: nameFunc.
39 | for MYFILE in "$DEST7"*;
40 | do
41 | source "$MYFILE"
42 | done
43 |
44 |
45 | #==MAIN CODE==
46 | #call check for user input options
47 | checkinputFunc "$1"
48 | clear
49 | #Display opening screen title
50 | msgFunc line
51 | msgFunc highlight "cylon-deb"
52 | msgFunc norm "Debian based Linux Distro Maintenance Program"
53 | msgFunc norm "$(dpkg -s cylondeb 2> /dev/null | grep Version)"
54 | msgFunc norm "$(date +%T-%d-%a-Week%U-%b-%Y)"
55 | msgFunc norm "Unix epoch time $(date +%s)"
56 | msgFunc line
57 |
58 | #loop until user exit
59 | while true; do
60 | #reset path to $HOME
61 | cd ~ || exitHandlerFunc DEST4
62 | #call the display main menu function
63 | DisplayFunc
64 | done
65 | #== END ==
66 |
--------------------------------------------------------------------------------
/makefile:
--------------------------------------------------------------------------------
1 |
2 | PREFIX ?= /usr
3 |
4 | all:
5 | @echo Run \'make install\' to install cylondeb.
6 | @echo 'or'
7 | @echo Run \'make uninstall\' to uninstall cylondeb.
8 |
9 | install:
10 | @echo 'Installing cylondeb ....'
11 | @echo 'Making directories...'
12 | @mkdir -vp $(PREFIX)/bin
13 | @mkdir -vp $(PREFIX)/lib/cylondeb/modules
14 | @mkdir -vp $(PREFIX)/share/doc/cylondeb
15 |
16 | @echo 'Installing script...'
17 | @cp -vp main/cylondeb $(PREFIX)/bin
18 | @chmod 755 $(PREFIX)/bin/cylondeb
19 |
20 | @echo 'Installing modules...'
21 | @cp -vp modules/* $(PREFIX)/lib/cylondeb/modules
22 |
23 | @echo 'Installing Readme...'
24 | @cp -vp README.md $(PREFIX)/share/doc/cylondeb
25 |
26 | @echo 'Installing Desktop entry...'
27 | @cp -vp desktop/cylondeb.desktop $(PREFIX)/share/applications
28 |
29 | @echo 'Installing Desktop icon...'
30 | @cp -vp desktop/cylondebicon.png $(PREFIX)/share/pixmaps
31 |
32 | @echo 'DONE!'
33 |
34 | uninstall:
35 | @echo 'Uninstalling cylondeb ...'
36 |
37 | rm -vf $(PREFIX)/bin/cylondeb
38 | rm -vf $(PREFIX)/lib/cylondeb/modules/*Module
39 | rm -vf $(PREFIX)/share/doc/cylondeb/README.md
40 | rm -vf $(PREFIX)/share/applications/cylondeb.desktop
41 | rm -vf $(PREFIX)/share/pixmaps/cylondebicon.png
42 |
43 | @echo 'DONE!'
44 |
45 |
--------------------------------------------------------------------------------
/modules/MaintenanceModule:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #==HEADER==
3 | #Title: Bash shell Module called by program cylon-deb
4 | #Description: Holds functions related to System Maintenance
5 | #Function list: pkglistFunc , checkPacFunc , debupdateFunc , makeDirFunc
6 |
7 | #==FUNCTIONS==
8 | #FUNCTION HEADER
9 | # NAME : makeDirFunc
10 | # DESCRIPTION : makes a directory with time/date stamp and enters it
11 | #Directory used for program output and backups.
12 | # INPUTS : $1 text is appended to name
13 | function makeDirFunc
14 | {
15 | local dirVar=""
16 | cd "$DEST3" || exitHandlerFunc DEST3
17 | dirVar=$(date +%d%b%y-%H%M)"$1"
18 | mkdir "$dirVar"
19 | cd "$dirVar" || exitHandlerFunc DEST4
20 | msgFunc norm "Directory for output made at:-"
21 | pwd
22 | }
23 |
24 | #FUNCTION HEADER
25 | # NAME : pkglistFunc
26 | # INPUTS: $1 Backup if called from backup do not create directory
27 | # DESCRIPTION: Creates a copy of packages list see below.
28 | function pkglistFunc
29 | {
30 | local pid=""
31 | msgFunc green "Making a copy of package lists."
32 | makeDirFunc "-PKGINFO"
33 | # call spinner function put run in background and save PID
34 | echo " "
35 | spin &
36 | pid=$!
37 |
38 | # (1) all packages
39 | dpkg --list | grep ^i > all_PKG
40 | # (2) List native packages installed explicitly
41 | apt-mark showmanual > Exp_PKG
42 | # (3) List packages that are installed but are not available in any installation source
43 | deborphan > noinstall_PKG
44 | # (4) Get a dump of the whole system information -
45 | # Prints, Saves or similar the current state of the package management system.
46 | apt-cache stats > stats_PKG
47 | # (5) List packages that were recently added to one of the installation sources,
48 | aptitude search '~N' > Recent_add_PKG
49 | # (6) List packages not required by any other package
50 | deborphan -anp1 > non-Dep_PKG
51 | # (7) List packages installed automatically (as dependencies)
52 | apt-mark showauto > auto_Dep_PKG
53 | # (8) Prints a list of all installation sources including important information like URI, alias etc
54 | apt-cache policy > Info_Source_PKG
55 | # (9) list of non-standard repositories in use
56 | cat /etc/apt/sources.list.d/*.list | grep -v "^#" > non_standard_PKG
57 | # (10) list Installed packages by size
58 | aptitude search "~i" --display-format "%p %I" --sort installsize > install_size_PKG
59 | # (11) list packages by install date
60 | grep installed /var/log/dpkg.log > Install_date_1_PKG
61 | # (12) list packages by install date less data
62 | grep " install " /var/log/dpkg.log > Install_date_2_PKG
63 |
64 | # Stop spin function with PID
65 | kill $pid
66 | echo " "
67 | }
68 |
69 | #FUNCTION HEADER
70 | # NAME : checkPacFunc
71 | #DESCRIPTION : Checks if package installed
72 | #PROCESS: check if package(passed $1) installed if NOMES passed
73 | #as $2 goto menu display mode and appends passed $3
74 | #NOMES =no message
75 | # INPUTS : $1(package $2(NOMES flag) or (append text))
76 | #OUTPUTS: returns 0 for installed 1 for not installed
77 | function checkPacFunc
78 | {
79 | local pacVar=""
80 | pacVar=$(dpkg -l "$1" 2> /dev/null)
81 | if [ -n "$pacVar" ]
82 | then #installed
83 | #if text input is NOMES skip install good message
84 | if [ "$2" = "NOMES" ]
85 | then
86 | printf '%s' "$1"
87 | else
88 | printf '%s\n' "$1 is Installed $2"
89 | fi
90 | return 0
91 | else #not installed
92 | #if text input is NOMES skip install bad message
93 | if [ "$2" = "NOMES" ]
94 | then
95 | printf '%s' "$1 n/a"
96 | else
97 | printf '%s\n' "${RED}$1 is Not installed${NORMAL} $2"
98 | fi
99 | return 1
100 | fi
101 | }
102 |
103 | #FUNCTION HEADER
104 | # NAME : debmenuoneFunc
105 | # DESCRIPTION : debian manager options menu number one
106 | # PROCESS : See options array
107 | function debmenuoneFunc
108 | {
109 | clear
110 | while true; do
111 | local pacString=""
112 | msgFunc blue "Maintenance options menu one:-"
113 | options=("Check for updates (no download), aptitude search '~U'" \
114 | "Upgrade all, apt update && apt dist-upgrade" \
115 | "Install Package, apt install" \
116 | "Delete Package, apt remove" \
117 | "Display remote package information, apt-cache show" \
118 | "Search for packages in the database, apt search" \
119 | "Search for already installed packages, aptitude search '~i'" \
120 | "Display info for locally installed packages, dpkg -s" \
121 | "List all files owned by a given package, dpkg -L " \
122 | "Write installed package lists to files" \
123 | "View dpkg log file at /var/log/dpkg.log" \
124 | "Show all or most information about a package, apt show " \
125 | "Show the changelog of a package, apt-get changelog" \
126 | "Verify all packages, debsums" \
127 | "Verify dependencies of the complete system, apt-get check" \
128 | "Add a PPA to system, add-apt-repository ppa:" \
129 | "Purge a PPA from system, ppa-purge" \
130 | "Return to main menu")
131 |
132 | select choicep in "${options[@]}"
133 | do
134 | case "$choicep" in
135 | "${options[0]}") #check for updates
136 | msgFunc green "Updates ready:-.... "
137 | msgFunc norm "Number of updates ready...> $(aptitude search '~U' | wc -l)"
138 | aptitude search '~U'
139 | ;;
140 |
141 | "${options[1]}") #update system
142 | msgFunc green "Update system"
143 | sudo apt update && sudo apt dist-upgrade
144 | ;;
145 |
146 | "${options[2]}") # Install Package
147 | msgFunc green "Install package."
148 | msgFunc norm "Please enter package name"
149 | read -r pacString
150 | sudo apt install "$pacString"
151 | ;;
152 |
153 | "${options[3]}") #Delete Package
154 | msgFunc green "Delete Package."
155 | msgFunc norm "Please enter package name"
156 | read -r pacString
157 | sudo apt remove "$pacString"
158 | ;;
159 |
160 | "${options[4]}") # Display remote package information
161 | msgFunc green "Display information for Package."
162 | msgFunc norm "Please enter package name"
163 | read -r pacString
164 | apt-cache show "$pacString"
165 | ;;
166 | "${options[5]}") #Search Repos for Package
167 | msgFunc green "Search for packages in the database."
168 | msgFunc norm "Please enter package name"
169 | read -r pacString
170 | apt search "$pacString"
171 | ;;
172 |
173 | "${options[6]}") #Search for already installed packages
174 | msgFunc green "Search for already installed packages."
175 | msgFunc norm "Please enter package name"
176 | read -r pacString
177 | aptitude search "~i(~n $pacString|~d $pacString)"
178 | ;;
179 |
180 | "${options[7]}") #Display extensive information about a given package(local install)
181 | msgFunc green "Display information for Package."
182 | msgFunc norm "Please enter package name"
183 | read -r pacString
184 | dpkg -s "$pacString"
185 | ;;
186 |
187 | "${options[8]}") #List all files owned by a given package.
188 | msgFunc green "List all files owned by a given package."
189 | msgFunc norm "Please enter package name"
190 | read -r pacString
191 | dpkg -L "$pacString"
192 | ;;
193 |
194 | "${options[9]}") #pkglist
195 | msgFunc green "Writing installed package lists to files at :"
196 | pkglistFunc
197 | ;;
198 |
199 | "${options[10]}") #Show a log of actions taken by the software management.
200 | msgFunc green "Show a log of actions taken by the software management."
201 | less /var/log/dpkg.log
202 | ;;
203 |
204 | "${options[11]}") #Show all or most information about a package
205 | msgFunc green "Show all or most information about a package"
206 | msgFunc norm "Please enter package name"
207 | read -r pacString
208 | apt show "$pacString"
209 | ;;
210 |
211 | "${options[12]}") #Show the changelog of a package
212 | msgFunc green "Show the change log of a package"
213 | msgFunc norm "Please enter package name"
214 | read -r pacString
215 | apt-get changelog "$pacString"
216 | ;;
217 |
218 | "${options[13]}") # Verify all packages, debsums
219 | msgFunc green "Verify all packages, debsums Only report errors."
220 | makeDirFunc "-debsums"
221 | debsums -s --ignore-permissions > debsums.txt
222 | ;;
223 |
224 | "${options[14]}") # Verify dependencies of the complete system, apt-get check
225 | # Used if installation process was forcefully killed.
226 | msgFunc green "Verify dependencies of the complete system, apt-get check"
227 | sudo apt-get check
228 | ;;
229 |
230 | "${options[15]}") # Add a PPA to system, sudo add-apt-repository ppa:
231 | msgFunc green "Add a PPA to system, add-apt-repository ppa:"
232 | read -r pacString
233 | sudo add-apt-repository ppa:"$pacString"
234 | ;;
235 |
236 | "${options[16]}") #purge a PPA from system, sudo ppa-purge:
237 | msgFunc green "purge a PPA to system, sudo ppa-purge"
238 | read -r pacString
239 | sudo ppa-purge "$pacString"
240 | ;;
241 |
242 | *) #exit
243 | msgFunc green "Done!"
244 | return
245 | ;;
246 | esac
247 | break
248 | done
249 |
250 | msgFunc green "Done!"
251 | msgFunc anykey
252 | clear
253 | done
254 | }
255 |
256 | #FUNCTION HEADER
257 | # NAME : debmenutwoFunc
258 | # DESCRIPTION : debian manager options menu number two
259 | # PROCESS : See options array
260 | function debmenutwoFunc
261 | {
262 | clear
263 | while true; do
264 | local pacString=""
265 | msgFunc yellow "Warning Options 3-6 should be used with caution by advanced users"
266 | msgFunc blue "Maintenance options menu two:-"
267 |
268 | optionstwo=("Clean up all local cache, apt autoclean " \
269 | "Removes pkgs installed by other pkgs & no longer needed, apt autoremove " \
270 | "Remove pkg's no longer included in any repos,aptitude purge '~o'" \
271 | "Remove orphan packages with orphaner" \
272 | "Removing packages and configs which are not required" \
273 | "Remove orphaned packages automatically " \
274 | "Delete cylon output folder" \
275 | "Return to main menu")
276 | select choicepp in "${optionstwo[@]}"
277 | do
278 | case "$choicepp" in
279 |
280 | "${optionstwo[0]}") #Clean up all local caches.
281 | #Autoclean removes only unneeded, obsolete information.
282 | msgFunc green "Clean up all local cache."
283 | sudo apt autoclean
284 | ;;
285 | "${optionstwo[1]}") # Removes packages that were installed by other packages and are no longer needed.
286 | #Removes packages that were installed by other packages and are no longer needed.
287 | msgFunc green "Delete packages no longer needed!"
288 | sudo apt autoremove
289 | ;;
290 |
291 | "${optionstwo[2]}") # Remove packages no longer included in any repositories.
292 | msgFunc green "Remove packages no longer included in any repositories."
293 | sudo aptitude purge '~o'
294 | ;;
295 |
296 | "${optionstwo[3]}") # Remove orphan packages manually with orphaner utility
297 | msgFunc green "Remove orphan packages with orphaner"
298 | sudo orphaner
299 | ;;
300 |
301 | "${optionstwo[4]}")
302 | #Removing packages and configurations which are
303 | #not required by any other package upon your system
304 | msgFunc green "Removing packages and configurations which are "
305 | msgFunc green "not required by any other package upon your system"
306 | msgFunc norm " "
307 | msgFunc norm "Output of deborphan -n --find-config :-"
308 | deborphan -n --find-config
309 | msgFunc norm " "
310 | msgFunc norm "Press y to execute:- sudo deborphan -n --find-config | xargs apt-get -y purge"
311 | msgFunc norm "[y/n/q]?"
312 | if msgFunc yesno
313 | then # user said yes
314 | deborphan -n --find-config | xargs sudo apt-get -y purge
315 | fi
316 | ;;
317 | "${optionstwo[5]}")
318 | # remove orphaned packages automatically
319 | msgFunc green "Removing orphaned packages packages automatically"
320 | msgFunc norm " "
321 | msgFunc norm "Orphans on system :-"
322 | deborphan
323 | msgFunc norm " "
324 | msgFunc norm "Press y to execute:- deborphan | xargs sudo apt-get -y remove --purge"
325 | msgFunc norm "[y/n/q]?"
326 | if msgFunc yesno
327 | then # user said ye
328 | deborphan | xargs sudo apt-get -y remove --purge
329 | fi
330 | ;;
331 |
332 | "${optionstwo[6]}") #delete cylon ouput folder
333 | msgFunc green "Deleting Cylon output folder $DEST3"
334 | msgFunc norm "Output folder = $DEST3"
335 | msgFunc norm "Press y to delete"
336 | msgFunc norm "[y/n/q]"
337 |
338 | if msgFunc yesno
339 | then
340 | rm -rvf "$DEST3"
341 | #remake the path for the program output DEST3
342 | mkdir -p "$DEST3"
343 | fi
344 |
345 | ;;
346 |
347 | *) #exit
348 | msgFunc green "Done!"
349 | clear
350 | return
351 | ;;
352 | esac
353 | break
354 | done
355 |
356 | msgFunc green "Done!"
357 | msgFunc anykey
358 | clear
359 | done
360 | }
361 |
362 |
363 | #FUNCTION HEADER
364 | # NAME: spin
365 | # DESCRIPTION: Creates an animation spinner for long time taking process
366 | function spin
367 | {
368 | spinner=( Ooooo oOooo ooOoo oooOo ooooO oooOo ooOoo oOooo);
369 | while true; do
370 | for i in "${spinner[@]}";
371 | do
372 | # no new line , \r reset line
373 | echo -ne "\r$i";
374 | sleep 0.2;
375 | done;
376 | done
377 | }
378 |
--------------------------------------------------------------------------------
/modules/MiscModule:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #==HEADER==
3 | #Description: Called by Cylon-deb, Bash shell Module to hold miscellaneous functions
4 | #Function list: msgFunc , exitHandlerFunc , DisplayFunc , HelpFunc
5 | # checkinputFunc
6 |
7 | #==FUNCTIONS==
8 |
9 | #FUNCTION HEADER
10 | # NAME : msgFunc
11 | # DESCRIPTION : prints to screen
12 | #prints line, text and anykey prompts, yesno prompt
13 | # INPUTS : $1 process name $2 text input
14 | # PROCESS :[1] print line [2] anykey prompt
15 | # [3] print text "RGBY, norm yellow and highlight" [4] yn prompt,
16 | # OUTPUT yesno prompt return 1 or 0
17 | function msgFunc
18 | {
19 | case "$1" in
20 |
21 | line) #print blue horizontal line of =
22 | printf '\033[36;1m%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
23 | msgFunc norm
24 | ;;
25 | anykey) #any key prompt, appends second text input to prompt
26 | printf '%s' "${GREEN}"
27 | read -n 1 -r -s -p "Press any key to continue $2"
28 | printf '%s\n' "${NORMAL}"
29 | ;;
30 |
31 | #print passed text string
32 | green) printf '%s\n' "${GREEN}$2${NORMAL}" ;;
33 | red) printf '%s\n' "${RED}$2${NORMAL}" ;;
34 | blue) printf '%s\n' "${BLUE}$2${NORMAL}" ;;
35 | yellow)printf '%s\n' "${YELLOW}$2${NORMAL}" ;;
36 | highlight)printf '%s\n' "${HL}$2${NORMAL}" ;;
37 |
38 | norm) #print normal text colour
39 | if [ "$2" = "" ]
40 | then
41 | #just change colour to norm if no text sent
42 | printf '%s' "${NORMAL}"
43 | return
44 | fi
45 | printf '%s\n' "${NORMAL}$2" ;;
46 |
47 | yesno) #print yes no quit prompt
48 | local yesnoVar=""
49 | while true; do
50 | read -r yesnoVar
51 | case $yesnoVar in
52 | [Yy]*) return 0;;
53 | [Nn]*) return 1;;
54 | [Qq]*) exitHandlerFunc exitout;;
55 | *) printf '%s\n' "${YELLOW}Please answer: (y/Y for yes) OR (n/N for no) OR (q/Q to quit)!${NORMAL}";;
56 | esac
57 | done
58 | ;;
59 | *)
60 | printf '%s\n' "ERROR unknown input to msgFunc"
61 | ;;
62 | esac
63 | }
64 |
65 |
66 | #FUNCTION HEADER
67 | # NAME : exitHandlerFunc
68 | # DESCRIPTION: error handler deal with user
69 | #exists and path not found errors and internet failure
70 | # INPUTS: $2 text of filename
71 | # PROCESS : exitout DEST 3-4 6-7 or file error
72 | function exitHandlerFunc
73 | {
74 | #double square brackets without use of quotes on matching pattern
75 | #for glob support
76 | if [[ "$1" = DEST* ]]
77 | then
78 | msgFunc red "Path not found to Destination directory"
79 | fi
80 | case "$1" in
81 | exitout) msgFunc norm "";;
82 | DEST3) msgFunc red "Output folder: $DEST3" ;;
83 | DEST4) msgFunc red "General: $DEST4" ;;
84 | DEST6) msgFunc red "Readme: $DEST6" ;;
85 | DEST7) msgFunc red "Modules: $DEST7" ;;
86 | fileerror) msgFunc red "File error $2" ;;
87 | *) msgFunc yellow "unknown input to error handler";;
88 | esac
89 | msgFunc yellow "Goodbye $USER!"
90 | msgFunc anykey "and exit."
91 | if [ "$1" = "exitout" ]
92 | then
93 | #non-error exit
94 | exit 0
95 | fi
96 | exit 1
97 | }
98 |
99 | #FUNCTION HEADER
100 | # NAME : DisplayFunc
101 | # DESCRIPTION : Function to display main menu
102 | function DisplayFunc
103 | {
104 | msgFunc blue "Main Menu:"
105 | local choiceMainVar
106 | local optionsMArr=(
107 | "System Maintenance Menu 1 " "System Maintenance Menu 2 " "System Maintenance Menu 3 " "Open a xterm terminal at cylondeb output folder" \
108 | "System Information Display " "Cylondeb Information Display" "Exit"\
109 | )
110 | select choiceMainVar in "${optionsMArr[@]}"
111 | do
112 | case "$choiceMainVar" in
113 | "${optionsMArr[0]}") # Menu number one
114 | debmenuoneFunc
115 | ;;
116 |
117 | "${optionsMArr[1]}") # Menu number one
118 | debmenutwoFunc
119 | ;;
120 |
121 | "${optionsMArr[2]}") # Menu number one
122 | SystemMaintFunc
123 | ;;
124 |
125 | "${optionsMArr[3]}") # open a terminal
126 | xterm -e "cd $DEST3 && /bin/bash"
127 | msgFunc anykey
128 | ;;
129 |
130 | "${optionsMArr[4]}") #system info
131 | HelpFunc "SYS"
132 | ;;
133 |
134 | "${optionsMArr[5]}") # cylon info
135 | HelpFunc "HELP"
136 | ;;
137 |
138 | *) exitHandlerFunc exitout ;; #exit
139 | esac
140 | break
141 | done
142 |
143 | }
144 |
145 | #FUNCTION HEADER
146 | # NAME : HelpFunc
147 | # DESCRIPTION : two sections one prints various system information the
148 | # other cylon-deb information and the installed readme file
149 | # INPUTS : $1 process name either HELP or SYS
150 | # PROCESS :[1] HELP =cylon info [2] SYS =system info
151 | function HelpFunc
152 | {
153 | clear
154 | msgFunc line
155 | if [ "$1" = "HELP" ]
156 | then
157 | msgFunc green "Cylon-deb information and readme.md file display."
158 | msgFunc line
159 | msgFunc norm "Written by G.Lyons, Reports to or upstream URL"
160 | msgFunc norm "Launch Pad, Personal package archive name = cylondeb"
161 | msgFunc norm "https://launchpad.net @ ppa:typematrix/cylondeb"
162 | msgFunc norm "Upstream URL https://github.com/gavinlyonsrepo/cylon-deb"
163 | msgFunc norm "$(dpkg -s cylondeb 2> /dev/null | grep Version)"
164 | msgFunc norm "cylon-deb program location = $(which cylondeb)"
165 | msgFunc norm "Folder for Cylon-deb output data = $DEST3"
166 | if [ -z "${CYLONDEST}" ]
167 | then
168 | msgFunc norm "Environment variable CYLONDEST is not Set"
169 | else
170 | msgFunc norm "Environment variable CYLONDEST is set to $CYLONDEST"
171 | fi
172 |
173 | # Dependencies section
174 | msgFunc anykey "and check which dependencies are installed"
175 | clear
176 | msgFunc norm " "
177 | msgFunc green "Dependencies"
178 | #create array to hold Dependencies
179 | local DependenciesArr=("aptitude" "deborphan" "debsums" "ppa-purge" "bleachbit")
180 | #loop thru and display the array
181 | #length of array
182 | local tLenVar=""
183 | tLenVar="${#DependenciesArr[@]}"
184 | for (( i=0; i<"${tLenVar}"; i++ ));
185 | do
186 | checkPacFunc "${DependenciesArr[i]}"
187 | done
188 | msgFunc green "Done!"
189 | msgFunc green "Do you want to view readme? [y/n] ?"
190 | if msgFunc yesno
191 | then #yes
192 | msgFunc line
193 | msgFunc green "Displaying cylondeb README.md file at $DEST6"
194 | cd "$DEST6" || exitHandlerFunc DEST6
195 |
196 | if [ -f README.md.gz ]
197 | then
198 | zless README.md.gz
199 | elif [ -f README.md ]
200 | then
201 | less README.md
202 | else
203 | exitHandlerFunc README
204 | fi
205 |
206 | msgFunc green "Done!"
207 | msgFunc line
208 | msgFunc anykey
209 | fi
210 | msgFunc green "Done!"
211 | clear
212 | elif [ "$1" = "SYS" ]
213 | then
214 | msgFunc green "System Information display"
215 | msgFunc norm "Uptime = $(uptime -p)"
216 | msgFunc norm "Kernel name = $(uname -s)"
217 | msgFunc norm "Kernel version = $(uname -v)"
218 | msgFunc norm "Kernel release = $(uname -r)"
219 | msgFunc norm "Distribution = $(grep -s "DISTRIB_DESCRIPTION" /etc/*-release | cut -d'=' -f2)"
220 | msgFunc norm "Shell = $SHELL"
221 | msgFunc norm "Operating System = $(uname -o)"
222 | msgFunc norm "Machine hardware = $(uname -m)"
223 | msgFunc norm "Hardware platform = $(uname -i)"
224 | msgFunc norm "Network node name = $(uname -n)"
225 | msgFunc norm "User name = $USER"
226 | #screen resolution get
227 | if type -p xrandr >/dev/null; then
228 | msgFunc norm "Screen Resolution = $(xrandr |grep "\*" | cut -c 1-15)" 2>/dev/null
229 | elif type -p xdpyinfo >/dev/null; then
230 | msgFunc norm "Screen Resolution = $(xdpyinfo | awk -F '[ x]+' '/dimensions:/{print $3}') x $(xdpyinfo | awk -F '[ x]+' '/dimensions:/{print $4}')"
231 | fi
232 | msgFunc norm "CPU = $(grep name /proc/cpuinfo | tail -1| cut -d ":" -f 2)"
233 | # Memory
234 | mem=($(awk -F ':| kB' '/MemTotal|MemAvail/ {printf $2}' /proc/meminfo))
235 | memused="$((mem[0] - mem[1]))"
236 | memused="$((memused / 1024))"
237 | memtotal="$((mem[0] / 1024))"
238 | memory="${memused}MB / ${memtotal}MB"
239 | msgFunc norm "RAM used/total = ($memory)"
240 | msgFunc norm "Number of orphan packages not required as dependencies: $(deborphan | wc -l)"
241 | msgFunc norm "Number of packages = $(dpkg -l | wc -l)"
242 | msgFunc norm "Biggest package = $(aptitude search "~i" --display-format "%p" --sort installsize| tail -n 1)"
243 | msgFunc anykey
244 | clear
245 | fi
246 | }
247 |
248 | #FUNCTION HEADER
249 | # NAME : checkinputFunc
250 | # DESCRIPTION:CHECK INPUT OPTIONS from linux command line arguments passed to program on call
251 | # INPUTS : $1 user input option
252 | #-v display version and exit
253 | #-s display system info and exit
254 | #-h display cylon info and exit
255 | function checkinputFunc
256 | {
257 | case "$1" in
258 | "");;
259 | -p|--packlist)
260 | clear
261 | pkglistFunc
262 | ;;
263 | -v|--version)
264 | local VersionData
265 | VersionData=$(dpkg -s cylondeb 2> /dev/null | grep Version)
266 | if [[ -n "$VersionData" ]] ; then
267 | msgFunc norm "$VersionData" # installed by PPA
268 | else
269 | msgFunc norm "Version 2.4" # installed by makefile
270 | fi
271 | ;;
272 | -s|--system)
273 | HelpFunc SYS
274 | ;;
275 | -h|--help)
276 | HelpFunc HELP
277 | ;;
278 |
279 | -b|--bleachbit)
280 | SystemCleanFunc
281 | ;;
282 | *) msgFunc red "Invalid option!"
283 | msgFunc yellow "Usage: -h -s -v -p -b"
284 | msgFunc yellow "See readme.md for details at cylondeb -h "
285 | ;;
286 | esac
287 |
288 | #was there a input if yes quit?
289 | if [ -n "$1" ]
290 | then
291 | msgFunc anykey
292 | exit 0
293 | fi
294 | }
295 |
296 |
--------------------------------------------------------------------------------
/modules/SystemCleanModule:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #Module containing functions called from cylondeb package
3 | #Functions: SystemCleanFunc
4 |
5 | #FUNCTION HEADER
6 | # NAME : SystemCleanFunc
7 | # DESCRIPTION: Function for cleaning programs files and system
8 | # with bleachbit also deletes trash can and download folder.
9 | # INPUTS : $1 FOLDERS option
10 | #NOTES : needs bleachit installed
11 | function SystemCleanFunc
12 | {
13 | clear
14 | #check bleachbit is installed
15 | if ! checkPacFunc bleachbit
16 | then
17 | msgFunc anykey
18 | return
19 | fi
20 | #check $1, Called with FOLDERS input option?
21 | #delete folders and shred with bleachbit options
22 | local choiceFsVar=""
23 | if [ "$1" = "FOLDERS" ]
24 | then
25 | msgFunc blue "Delete files/folders. options:-"
26 | local optionsFsArr=("$(checkPacFunc bleachbit NOMES) shred file function" "$(checkPacFunc bleachbit NOMES) shred folder function" \
27 | "Return")
28 | select choiceFsVar in "${optionsFsArr[@]}"
29 | do
30 | case "$choiceFsVar" in
31 | "${optionsFsArr[0]}")
32 | local mydelfileVar=""
33 | mydelfileVar=$(dialog --title "Bleachbit Delete file" --output-fd 1 --title "Please choose a file" --fselect "$HOME/" 14 48)
34 | #echo "${FILE} file chosen."
35 | case $? in
36 | 0)
37 | clear
38 | ;;
39 | 1)
40 | clear
41 | msgFunc yellow "Exit pressed."
42 | return
43 | ;;
44 | 255)
45 | clear
46 | msgFunc yellow "Esc pressed."
47 | return
48 | ;;
49 | esac
50 | msgFunc norm "\"$mydelfileVar\" chosen file."
51 | msgFunc green "Execute bleachbit to delete file $mydelfileVar ? "
52 | msgFunc red "Press y or n [y/n] ?"
53 | if msgFunc yesno
54 | then #yes
55 | bleachbit -s "$mydelfileVar" || exitHandlerFunc exitout
56 | else
57 | msgFunc green "No selected"
58 | return
59 | fi
60 | ;;
61 |
62 | "${optionsFsArr[1]}")
63 | msgFunc green "Shred specific folder"
64 | local mydelpathVar=""
65 | mydelpathVar=$(dialog --title "Bleachbit Delete folder" --output-fd 1 --begin 1 1 --cancel-label "Exit" --title "Select folder to delete:" --dselect / 10 40)
66 | case $? in
67 | 0)
68 | clear
69 | ;;
70 | 1)
71 | msgFunc norm " "
72 | msgFunc yellow "Exit pressed."
73 | return
74 | ;;
75 | 255)
76 | msgFunc norm " "
77 | msgFunc yellow "Esc pressed."
78 | return
79 | ;;
80 | esac
81 | msgFunc norm "\"$mydelpathVar\" chosen directory."
82 | msgFunc green "Execute bleachbit to delete folder $mydelpathVar ? "
83 | msgFunc red "Press y or n [y/n] ?"
84 | if msgFunc yesno
85 | then #yes
86 | bleachbit -s "$mydelpathVar" || exitHandlerFunc exitout
87 | else
88 | msgFunc norm "No selected"
89 | return
90 | fi
91 | ;;
92 | *) #exit
93 | msgFunc green "Done!"
94 | return
95 | ;;
96 | esac
97 | break
98 | done
99 | return
100 | fi
101 |
102 | #system clean with bleachbit (if this function called without "FOLDERS" input)
103 | #query for preset option or custom?
104 | msgFunc norm "Note: For Preset options see $HOME/.config/bleachbit/ or GUI "
105 | msgFunc green "Bleachbit system clean. Use the Preset options set by GUI, q to quit [y/n/q]?"
106 | if msgFunc yesno
107 | then #yes
108 | #use options set in the graphical interface
109 | msgFunc norm "Running bleachbit -c --preset"
110 | bleachbit -c --preset
111 | return
112 | fi
113 |
114 | #custom bleachbit -c cleaner.option
115 | #get cleaner list and put it in array
116 | msgFunc green "Scanning bleachbit cleaners:"
117 | local cleanArr
118 | cleanArr=$(bleachbit --list | awk -F"." '{ print $1 }' | sort -u)
119 | #Sort array
120 | IFS=$'\n' cleanArr=($(sort <<<"${cleanArr[*]}"))
121 | unset IFS
122 | # get length of an array
123 | tLen="${#cleanArr[@]}"
124 | # use for loop read all installed packages exception for deepscan
125 | for (( i=0; i<"${tLen}"; i++ ));
126 | do
127 | if [ "${cleanArr[i]}" != "deepscan" ]
128 | then
129 | if ! checkPacFunc "${cleanArr[i]}"
130 | then
131 | unset "cleanArr[i]"
132 | fi
133 | fi
134 | done
135 | msgFunc anykey
136 | msgFunc green "Done!"
137 | clear
138 |
139 | #get cleaner input from user
140 | msgFunc blue "System clean with Bleachbit, Select Cleaner :-"
141 | local cleanerVar=""
142 | select cleanerVar in "${cleanArr[@]}"
143 | do
144 | #get list of options for selected cleaner and put in array
145 | local optionArr
146 | optionArr=$(bleachbit --list | awk -F"." ''/"${cleanerVar}"/' {print $2}')
147 | break
148 | done
149 | #check for valid selection
150 | if [ "$cleanerVar" = "" ]
151 | then
152 | return
153 | fi
154 | IFS=$'\n' optionArr=($(sort <<<"${optionArr[*]}"))
155 | unset IFS
156 | #Add a star to end of array
157 | optionArr+=('*')
158 | #show user options
159 | msgFunc blue "Select option(* is all):-"
160 | local optionVar=""
161 | select optionVar in "${optionArr[@]}"
162 | do
163 | if [ "$optionVar" = "" ]
164 | then
165 | return
166 | fi
167 | msgFunc norm " "
168 | msgFunc green "You have selected ${cleanerVar}.${optionVar}"
169 | msgFunc anykey
170 | break
171 | done
172 |
173 | local choiceBBOVar=""
174 | #give user 4 options - preview ,clean ,clean and overwrite ,quit
175 | msgFunc blue "Pick a Bleachbit option (see readme for more details)"
176 | select choiceBBOVar in "Preview only" "Overwrite & delete" "Delete" "Return"
177 | do
178 | case "$choiceBBOVar" in
179 | "Preview only" )
180 | bleachbit -p "${cleanerVar}.${optionVar}"
181 | ;;
182 | "Overwrite & delete")
183 | if [ "$cleanerVar" = "system" ]
184 | then
185 | sudo bleachbit -oc "${cleanerVar}.${optionVar}"
186 | else
187 | bleachbit -oc "${cleanerVar}.${optionVar}"
188 | fi
189 | ;;
190 | "Delete")
191 | if [ "$cleanerVar" = "system" ]
192 | then
193 | sudo bleachbit -c "${cleanerVar}.${optionVar}"
194 | else
195 | bleachbit -c "${cleanerVar}.${optionVar}"
196 | fi
197 | ;;
198 | *)
199 | return
200 | ;;
201 | esac
202 | break
203 | done
204 | }
205 |
--------------------------------------------------------------------------------
/modules/SystemMaintModule:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #Module containing functions called from cylon package
3 | #Functions: SystemMaintFunc configFileScanFunc
4 |
5 | #FUNCTION HEADER
6 | # NAME : SystemMaintFunc
7 | # DESCRIPTION:carries out maintenance checks
8 | # OUTPUTS : various output files
9 | # PROCESS : systemd , SSD trim , broken syslinks ,journalcontrol errors
10 | #lostfiles check with lostfiles package, systemdanalysis boot,
11 | #NOTES : needs lostfiles (AUR) installed
12 |
13 | function SystemMaintFunc
14 | {
15 | clear
16 | local optionsSMArr=("Failed Systemd Services and status" "Check Journalctl log for Errors"\
17 | "Check Journalctl for fstrim SSD trim" "Analyze system boot-up performance"\
18 | "Check for Broken Symlinks" "Find files where no group or User corresponds to file's numeric ID"\
19 | "Diskspace usage" "Find 200 of the biggest files" "Find inodes usage" "Old configuration files scan"\
20 | "Print sensors information" "Clean journal files"\
21 | "Delete core dumps /var/lib/systemd/coredump/" "Delete files"\
22 | "$(checkPacFunc bleachbit NOMES)"\
23 | "List All Open Files" "Return")
24 | while true; do # loop until exit
25 | local choiceSMVar=""
26 | #change dir for log files
27 | makeDirFunc "-SYSINFO"
28 | msgFunc blue "System Maintenance options"
29 | select choiceSMVar in "${optionsSMArr[@]}"
30 | do
31 | case "$choiceSMVar" in
32 | "${optionsSMArr[0]}")
33 | # -systemd --failed:
34 | msgFunc green "Systemd status"
35 | msgFunc green "Done!"
36 | systemctl status > Systemdstatus
37 | msgFunc green "All Failed Systemd Services"
38 | systemctl --failed --all
39 | systemctl --failed --all > Systemderrlog
40 | msgFunc green "Done!"
41 | msgFunc green "All Failed Active Systemd Services"
42 | systemctl --failed
43 | systemctl --failed >> Systemderrlog
44 | ;;
45 | "${optionsSMArr[1]}")
46 | # -Logfiles:
47 | msgFunc green "Check log Journalctl for Errors"
48 | journalctl -p 3 -xb > Journalctlerrlog
49 | ;;
50 |
51 | "${optionsSMArr[2]}")
52 | #check if ssd trim functioning ok in log
53 | #am I on a sdd drive? , 0 for SDD 1 for HDD from command
54 | local sdxVar=""
55 | sdxVar="$(df /boot/ --output=source | tail -1 | cut -c 6-8)"
56 | sdxVar=$(grep 0 /sys/block/"$sdxVar"/queue/rotational)
57 | if [ "$sdxVar" = "0" ]
58 | then
59 | msgFunc green "Check Journalctl for fstrim SSD trim"
60 | echo "SSD trim" > JournalctlerrSDDlog
61 | journalctl -u fstrim > JournalctlerrSDDlog
62 | else
63 | msgFunc red "HDD detected no SSD trim check done"
64 | fi
65 | ;;
66 |
67 | "${optionsSMArr[3]}")
68 | # systemd-analyze - Analyze system boot-up performance
69 | msgFunc green "Analyze system boot-up performance"
70 | {
71 | echo "Analyze boot-up performance"
72 | systemd-analyze time
73 | echo "CRITICAL-CHAIN"
74 | systemd-analyze critical-chain
75 | echo "BLAME"
76 | systemd-analyze blame
77 | } >> systemdanalyzelog
78 | ;;
79 | "${optionsSMArr[4]}")
80 | #Checking for broken symlinks:
81 | msgFunc green "Checking for Broken Symlinks"
82 | #root or home?
83 | msgFunc norm "Do you want to scan / or $HOME? [R/h]"
84 | local choiceSYMVar
85 | read -r choiceSYMVar
86 | if [ "$choiceSYMVar" = "h" ]
87 | then
88 | find "$HOME" -type l -! -exec test -e {} \; -print > symlinkerr
89 | else
90 | find / -path /proc -prune -o -type l -! -exec test -e {} \; -print 2>/dev/null > symlinkerr
91 | fi
92 | msgFunc anykey
93 | ;;
94 |
95 | "${optionsSMArr[5]}")
96 | msgFunc green "Find files where no group or User corresponds to file's numeric user/group ID."
97 | find / -nogroup > filenogrouplog 2> /dev/null
98 | find / -nouser > filenouserlog 2> /dev/null
99 | ;;
100 |
101 | "${optionsSMArr[6]}")
102 | msgFunc green "Diskspace usage"
103 | # This is GOLD for finding out what is taking so much space on your drives!
104 | msgFunc norm "Do you want to scan / or $HOME? [R/h]"
105 | local choiceDUVar=""
106 | read -r choiceDUVar
107 | if [ "$choiceDUVar" = "h" ]
108 | then
109 | du -H "$HOME" 2> /dev/null | sort -n -r >> diskspace
110 | else
111 | du -H / 2> /dev/null | sort -n -r >> diskspace
112 | fi
113 |
114 | ;;
115 | "${optionsSMArr[7]}") #find files
116 | msgFunc green "Find 200 of the biggest files"
117 | find / -type f -exec du -Sh {} + 2>/dev/null | sort -rh | head -n 200 > filesortsize
118 | ;;
119 | "${optionsSMArr[8]}") #inodes
120 | msgFunc green "Find inodes usage"
121 | df -ih | grep sd.
122 | msgFunc norm "Output list to fileinodescan"
123 | du / -Sh --inodes 2>/dev/null | sort -nr | head -2000 >fileinodescan
124 | ;;
125 | "${optionsSMArr[9]}") #old config files
126 | configFileScanFunc
127 | ;;
128 | "${optionsSMArr[10]}")
129 | msgFunc green "Print sensor information"
130 | sensors
131 | ;;
132 | "${optionsSMArr[11]}")
133 | msgFunc green "Clean journalctl files(systemd logging system)"
134 | msgFunc norm "Remove archived journal files until the disk space they use falls "
135 | msgFunc norm "below 100M: press y or any other key to quit [y/n] ?"
136 | if msgFunc yesno
137 | then #yes
138 | sudo journalctl --vacuum-size=100M
139 | else
140 | return
141 | fi
142 | ;;
143 | "${optionsSMArr[12]}")
144 | msgFunc green "Delete core dumps /var/lib/systemd/coredump/"
145 | sudo rm -rvf /var/lib/systemd/coredump/*
146 | ;;
147 | "${optionsSMArr[13]}") # delete folders /files
148 | SystemCleanFunc "FOLDERS"
149 | ;;
150 |
151 | "${optionsSMArr[14]}") #system clean with bleachbit
152 | SystemCleanFunc
153 | ;;
154 |
155 | "${optionsSMArr[15]}") # List All Open Files
156 | find /proc/*/fd -xtype f -printf "%l\n" 2>/dev/null |grep -v " (deleted)$"| sort -u
157 | ;;
158 |
159 | *)#quit
160 | msgFunc green "Done!"
161 | clear
162 | return
163 | ;;
164 |
165 | esac
166 | break
167 | done
168 | msgFunc green "Done!"
169 | msgFunc anykey
170 | clear
171 | done
172 | }
173 |
174 |
175 | #FUNCTION HEADER
176 | # NAME : configFileScanFunc
177 | # DESCRIPTION: Old configuration files scan see below text
178 | function configFileScanFunc
179 | {
180 | msgFunc green "Old configuration files scan"
181 | cat <<-EOF
182 | Old configuration files may conflict with newer software versions,
183 | or corrupt over time. Remove unneeded configurations periodically,
184 | This option will scan three folders and compare names of dirs with
185 | names of installed packages and output result to files.
186 | ~/.config/ -- where apps stores their configuration
187 | ~/.cache/ -- cache of some programs may grow in size
188 | ~/.local/share/ -- old files may be lying there
189 | The user can then inspect these files and remove anything unwanted.
190 | EOF
191 | msgFunc anykey
192 | local configArr=()
193 | local cacheArr=()
194 | local homeArr=()
195 | #populate arrays
196 | configArr=($(find "$HOME/.config" -maxdepth 1 -type d | awk -F"/" '{print $5}'))
197 | cacheArr=($(find "$HOME/.cache" -maxdepth 1 -type d | awk -F"/" '{print $5}'))
198 | homeArr=($(find "$HOME/.local/share" -maxdepth 1 -type d | awk -F"/" '{print $6}'))
199 | #sort arrays
200 | IFS=$'\n' configArr=($(sort <<<"${configArr[*]}"))
201 | unset IFS
202 | IFS=$'\n' cacheArr=($(sort <<<"${cacheArr[*]}"))
203 | unset IFS
204 | IFS=$'\n' homeArr=($(sort <<<"${homeArr[*]}"))
205 | unset IFS
206 | # get length of an array
207 | tLen="${#configArr[@]}"
208 | tLen1="${#cacheArr[@]}"
209 | tLen2="${#homeArr[@]}"
210 |
211 | # use for loop read all installed packages
212 | msgFunc green "$HOME/.config/ -- where apps stores their configuration"
213 | for (( i=0; i<"${tLen}"; i++ ));
214 | do
215 | if checkPacFunc "${configArr[i]}"
216 | then
217 | unset "configArr[i]"
218 | fi
219 | done
220 | msgFunc anykey
221 | printf "%s\n" "${configArr[@]}" > HOMECONFIGfile
222 |
223 | # use for loop read all installed packages
224 | msgFunc green " $HOME/.cache/ -- cache of some programs may grow in size"
225 | for (( i=0; i<"${tLen1}"; i++ ));
226 | do
227 | if checkPacFunc "${cacheArr[i]}"
228 | then
229 | unset "cacheArr[i]"
230 | fi
231 | done
232 | msgFunc anykey
233 | printf "%s\n" "${cacheArr[@]}" > HOMECACHEfile
234 |
235 | # use for loop read all installed packages
236 | msgFunc green "$HOME/.local/share/ -- old files may be lying there"
237 | for (( i=0; i<"${tLen2}"; i++ ));
238 | do
239 | if checkPacFunc "${homeArr[i]}"
240 | then
241 | unset "homeArr[i]"
242 | fi
243 | done
244 | printf "%s\n" "${homeArr[@]}" > HOMELOCALSHAREfile
245 | }
246 |
--------------------------------------------------------------------------------
/screenshots/bleachbit_CLI_wrapper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/screenshots/bleachbit_CLI_wrapper.png
--------------------------------------------------------------------------------
/screenshots/main_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/screenshots/main_menu.png
--------------------------------------------------------------------------------
/screenshots/main_three.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/screenshots/main_three.png
--------------------------------------------------------------------------------
/screenshots/menu_one.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/screenshots/menu_one.png
--------------------------------------------------------------------------------
/screenshots/menu_two.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gavinlyonsrepo/cylon-deb/8a2abfa8cbd84173ac54b5f310326fa202aca011/screenshots/menu_two.png
--------------------------------------------------------------------------------