|
28 | 28 | URL="https://api.github.com/repos/bashpack-project/bashpack/tarball" # for Github tarball |
29 | 29 | # URL="https://github.com/bashpack-project/bashpack/archive/refs/heads" # for Github main branch |
30 | 30 |
|
31 | | -VERSION="0.2.19" |
| 31 | +VERSION="0.2.20" |
32 | 32 |
|
33 | 33 | NAME="Bashpack" |
34 | 34 | NAME_LOWERCASE=$(echo "$NAME" | tr A-Z a-z) |
|
62 | 62 | && echo "Options:" \ |
63 | 63 | && echo " -y, --assume-yes enable automatic installations without asking during the execution." \ |
64 | 64 | && echo " --ask ask to manually write your choice about updates installations confirmations." \ |
| 65 | + && echo " --get-logs display systemd logs." \ |
| 66 | + && echo " --when display systemd next service cycle." \ |
65 | 67 | && echo "" \ |
66 | 68 | && echo "" \ |
67 | 69 | && exit ;; |
68 | | - esac |
| 70 | + esac |
69 | 71 | ;; |
70 | 72 | --help) echo "$USAGE" \ |
71 | 73 | && echo "" \ |
72 | 74 | && echo "$NAME is a user-friendly Linux toolbox." \ |
73 | | - && echo "It has been designed for unexperimented Linux users and also for IT teams who needs to ensure security on their Linux laptop park." \ |
| 75 | + && echo "It has been designed for helping Linux users on their day to day tasks." \ |
| 76 | + && echo "It can also be useful for IT teams who needs to ensure security on their Linux park." \ |
74 | 77 | && echo "You can easily setup automations with the differents options." \ |
75 | 78 | && echo "" \ |
76 | 79 | && echo "Features:" \ |
|
84 | 87 | && echo " -i, --self-install install (or reinstall) $NAME on your system as the command '$NAME_ALIAS'." \ |
85 | 88 | && echo " -u, --self-update update your current $NAME installation to the latest available version." \ |
86 | 89 | && echo " --self-delete delete $NAME from your system." \ |
87 | | - && echo " --get-logs display systemd logs." \ |
88 | | - && echo " --when display systemd next service cycle." \ |
89 | 90 | && echo " --help display this information." \ |
90 | 91 | && echo " --version display version." \ |
91 | 92 | && echo "" \ |
@@ -202,12 +203,21 @@ COMMAND_SYSTEMD_STATUS="systemctl status $file_systemd_update.timer" |
202 | 203 | # Delete the installed command from the system |
203 | 204 | delete_cli() { |
204 | 205 |
|
205 | | - local files=( |
206 | | - $dir_src |
207 | | - $file_autocompletion |
208 | | - $file_main_alias |
209 | | - $file_main |
210 | | - ) |
| 206 | + local exclude_main=${1} |
| 207 | + |
| 208 | + if [[ $exclude_main = "exclude_main" ]]; then |
| 209 | + local files=( |
| 210 | + $dir_src |
| 211 | + $file_autocompletion |
| 212 | + ) |
| 213 | + else |
| 214 | + local files=( |
| 215 | + $dir_src |
| 216 | + $file_autocompletion |
| 217 | + $file_main_alias |
| 218 | + $file_main |
| 219 | + ) |
| 220 | + fi |
211 | 221 |
|
212 | 222 |
|
213 | 223 | if [[ $(exists_command "$NAME_ALIAS") != "exists" ]]; then |
@@ -285,7 +295,7 @@ delete_systemd() { |
285 | 295 |
|
286 | 296 | # Helper function to assemble all functions that delete something |
287 | 297 | delete_all() { |
288 | | - delete_systemd && delete_cli |
| 298 | + delete_systemd && delete_cli |
289 | 299 | } |
290 | 300 |
|
291 | 301 |
|
@@ -473,6 +483,9 @@ update_cli() { |
473 | 483 | # # Delete current installed version to clean all old files |
474 | 484 | # /!\ Deactivated for now because if we delete the last release from Github, the CLI is just beeing removed from the system... |
475 | 485 | # delete_all |
| 486 | + delete_systemd && delete_cli exclude_main |
| 487 | + |
| 488 | + echo "" |
476 | 489 |
|
477 | 490 | # Execute the install_cli function of the script downloaded in /tmp |
478 | 491 | exec "$archive_dir_tmp/$NAME_LOWERCASE.sh" -i |
|
0 commit comments