Skip to content

Commit 268e9a3

Browse files
authored
Merge pull request #12 from bashpack-project/working
0.2.24
2 parents b2a94aa + f41b465 commit 268e9a3

File tree

3 files changed

+22
-49
lines changed

3 files changed

+22
-49
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ Bashpack is a **user-friendly Linux toolbox**.
55
It has been designed for helping **Linux** users on their **day to day tasks**.
66
It can also be useful for IT teams who needs to ensure security on their Linux park.
77

8-
You can easily setup automations with the differents options.
8+
You can easily setup **automations** with the differents **options**.
99

1010
<br>
1111

1212
## Features
1313
* (available) Unified Linux updates ([APT](https://fr.wikipedia.org/wiki/Advanced_Packaging_Tool) and [Snapcraft](https://snapcraft.io/) packages (Snapcraft is not installed with this script, it just handled if already used)).
1414
* (incoming) Unified Linux updates (firmwares with [fwupd](https://github.com/fwupd/fwupd)).
15-
* (incoming) Linux firewall security (close ports with [nftables](https://wiki.nftables.org/wiki-nftables/index.php/Main_Page) ([Docker](https://www.docker.com/) compatible)).
15+
* (incoming) Secure Linux firewall (close ports with [nftables](https://wiki.nftables.org/wiki-nftables/index.php/Main_Page) ([Docker](https://www.docker.com/) compatible)).
1616
* (incoming) Routes over VPN to one or many points ([OpenVPN](https://openvpn.net/) compatible).
1717

1818
<br>
1919

2020
## Quick start
2121
Copy/paste the following command blocks on your Linux terminal to manage your Bashpack installation.
2222
* _You must be sudo._
23-
* _Once installed, Bashpack will automatically update itself (it checks for updates once a day)._
23+
* _Once installed, Bashpack will automatically update itself once a day ([Systemd](https://systemd.io/) installations **only**)._
2424

2525
**Install**
2626
```javascript
2727
curl -sL https://raw.githubusercontent.com/bashpack-project/bashpack/main/bashpack.sh -o bashpack.sh \
2828
&& chmod +x bashpack.sh \
29-
&& sudo ./bashpack.sh -i
29+
&& sudo ./bashpack.sh -i \
30+
&& rm bashpack.sh
3031
```
3132

3233
**Update**
@@ -46,30 +47,29 @@ sudo bp --self-delete
4647
```javascript
4748
bp --help
4849
```
49-
<br>
50-
51-
**Builtin automations** are automatically configured with [Systemd](https://systemd.io/) on your system.
5250

5351
<br>
5452

53+
5554
### Unified Linux updates
56-
Launch an automatic update of everything on your system:
55+
Launch a pre-validated update of everything on your system:
5756
```javascript
5857
sudo bp update -y
5958
```
60-
Check next update:
59+
60+
Check next update ([Systemd](https://systemd.io/) installations **only**):
6161
```javascript
6262
sudo bp update --when
6363
```
64-
Get logs from last update:
64+
Get logs from last update ([Systemd](https://systemd.io/) installations **only**):
6565
```javascript
6666
sudo bp update --get-logs
6767
```
6868

6969
<br>
7070

7171

72-
### Linux firewall security
72+
### Secure Linux firewall
7373
Incoming
7474

7575
<br>
@@ -78,4 +78,4 @@ Incoming
7878
### Routes over VPN
7979
Incoming
8080

81-
<br>
81+
<br>

bash_completion

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ _bashpack() {
2727
local prev=${COMP_WORDS[COMP_CWORD-1]}
2828

2929
case ${COMP_CWORD} in
30-
1) COMPREPLY=($(compgen -W "update man --get-logs --version --help --self-install --self-update --self-delete" -- ${cur})) ;;
30+
1) COMPREPLY=($(compgen -W "update man --version --help --self-install --self-update --self-delete" -- ${cur})) ;;
3131
2)
3232
case ${prev} in
33-
update) COMPREPLY=($(compgen -W "--help --assume-yes --ask --when" -- ${cur})) ;;
33+
update) COMPREPLY=($(compgen -W "--help --assume-yes --ask --when --get-logs" -- ${cur})) ;;
3434
esac ;;
3535
*) COMPREPLY=() ;;
3636
esac

bashpack.sh

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424

2525

2626

27-
#URL="http://localhost" # for local web server
28-
URL="https://api.github.com/repos/bashpack-project/bashpack/tarball" # for Github tarball
29-
# URL="https://github.com/bashpack-project/bashpack/archive/refs/heads" # for Github main branch
27+
URL="https://api.github.com/repos/bashpack-project/bashpack/tarball" # Github latest tarball
3028

31-
VERSION="0.2.23"
29+
VERSION="0.2.24"
3230

3331
NAME="Bashpack"
3432
NAME_LOWERCASE=$(echo "$NAME" | tr A-Z a-z)
@@ -71,32 +69,18 @@ else
7169
;;
7270
--help) echo "$USAGE" \
7371
&& echo "" \
74-
&& echo "$NAME is a user-friendly Linux toolbox." \
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." \
77-
&& echo "You can easily setup automations with the differents options." \
78-
&& echo "" \
79-
&& echo "Features:" \
80-
&& echo " (available) Unified Linux updates (packages)." \
81-
&& echo " (incoming) Unified Linux updates (firmwares)." \
82-
&& echo " (incoming) Linux firewall security (close ports with nftables - Docker compatible)." \
83-
&& echo " (incoming) Routes over VPN to one or many points (OpenVPN compatible)." \
84-
&& echo "" \
85-
&& echo "" \
8672
&& echo "Options:" \
8773
&& echo " -i, --self-install install (or reinstall) $NAME on your system as the command '$NAME_ALIAS'." \
8874
&& echo " -u, --self-update update your current $NAME installation to the latest available version." \
8975
&& echo " --self-delete delete $NAME from your system." \
9076
&& echo " --help display this information." \
9177
&& echo " --version display version." \
9278
&& echo "" \
93-
&& echo "" \
9479
&& echo "Commands:" \
9580
&& echo " update [OPTION] use '$NAME_ALIAS update --help' for the command options." \
9681
&& echo "" \
9782
&& echo "" \
98-
&& echo "Written in Bash, and it's a pack." \
99-
&& echo "Version $VERSION" \
83+
&& echo "$NAME $VERSION" \
10084
&& exit ;;
10185
esac
10286
fi
@@ -331,14 +315,11 @@ archive_extract() {
331315

332316
# Download releases archives from the repository
333317
# Usages:
334-
# - download_cli <latest>
335-
# - download_cli <n.n.n>
318+
# - download_cli <url of latest>
319+
# - download_cli <url of n.n.n>
336320
download_cli() {
337321

338-
#local archive_name="$NAME_LOWERCASE-${1}.tar.gz" # for basic web server
339-
#local archive_url="$URL/$archive_name" # for basic web server
340-
local archive_url=${1} # for Github taball
341-
322+
local archive_url=${1}
342323

343324
# Prepare tmp directory
344325
rm -rf $archive_dir_tmp
@@ -464,8 +445,6 @@ create_cli() {
464445

465446

466447
# Clear temporary files & directories
467-
# rm -f $archive_tmp
468-
# rm -rf $archive_dir_tmp
469448
rm -rf $dir_tmp/$NAME_LOWERCASE* # Cleaning also temp files created during update process since create_cli is not called directly during update.
470449

471450

@@ -494,15 +473,10 @@ update_cli() {
494473
# Download a first time the latest version from the "main" branch to be able to launch the installation script from it to get latest modifications.
495474
# Ths install function will download the well-named archive with the version name
496475
# (so yes, it means that the CLI is downloaded twice)
497-
498-
#download_cli "main" # Github main branch
499-
#download_cli "main" 2>&1 > /dev/null # Github main branch
500-
#download_cli "$URL" 2>&1 > /dev/null # Github latest tarball
501-
download_cli "$URL" # Github latest tarball
476+
download_cli "$URL"
502477

503478
# Delete current installed version to clean all old files
504479
delete_all exclude_main
505-
#delete_systemd && delete_cli exclude_main
506480

507481
echo ""
508482

@@ -524,8 +498,7 @@ update_cli() {
524498
install_cli() {
525499
detect_cli
526500

527-
download_cli "$URL/$VERSION" # Github latest tarball
528-
#download_cli $VERSION # Github main branch
501+
download_cli "$URL/$VERSION"
529502

530503
create_cli
531504
}

0 commit comments

Comments
 (0)