Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8922fa8407 | ||
|
|
a126e48c8b | ||
|
|
d15ebb2ffe | ||
|
|
2d24b341bd | ||
|
|
2d450ee4c5 | ||
|
|
06eee6396f | ||
|
|
a813843b45 | ||
|
|
f597e2f3fd | ||
|
|
4c3ec0e908 | ||
|
|
7e39e7ca57 | ||
|
|
38ce3556d5 | ||
|
|
1c9d4954bd | ||
|
|
d1cc423b6f | ||
|
|
0a98849b51 | ||
|
|
96079d9852 | ||
|
|
adb9c26e9d | ||
|
|
7bed27828d | ||
|
|
890150296b | ||
|
|
afc7641507 | ||
|
|
53650bf566 | ||
|
|
5ec5ae079a | ||
|
|
5aec55c1d8 | ||
|
|
71e0f09200 | ||
|
|
5c3d9a0698 | ||
|
|
e117aecce3 | ||
|
|
fe63556a6b | ||
|
|
aaab48817e | ||
|
|
779af87faf | ||
|
|
71cacd8d7c | ||
|
|
5e38762db7 | ||
|
|
0d7f657da3 | ||
|
|
0ac03ebd21 | ||
|
|
d790829821 | ||
|
|
c103cc113e | ||
|
|
08691fccc4 | ||
|
|
319fbae448 | ||
|
|
f8a079eb6c | ||
|
|
f0a58090f6 | ||
|
|
45c64b1372 | ||
|
|
30b3a134a9 | ||
|
|
4cb7b35521 | ||
|
|
ce6685b105 | ||
|
|
7225126a8f | ||
|
|
ec41f3a2b4 | ||
|
|
4dd5627635 | ||
|
|
8a52d7b2f2 | ||
|
|
23f62982e6 | ||
|
|
14866d70ed | ||
|
|
f4922f9f7b | ||
|
|
9c0e359c25 | ||
|
|
7449b13936 | ||
|
|
3a0f248be0 | ||
|
|
0ae280bbe7 | ||
|
|
dbef7e8e34 | ||
|
|
4740a21549 | ||
|
|
894c70d40e | ||
|
|
4e9fc71e41 | ||
|
|
98b0939781 | ||
|
|
74531fba8c | ||
|
|
c4dc73fb32 | ||
|
|
1cb327c700 | ||
|
|
ea43a5f655 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -1,6 +1,27 @@
|
||||
# Changelog for ishare2
|
||||
All notable changes to this project will be documented in this file. You can upgrade ishare2 to the latest version using `ishare2 upgrade` and then selecting `option 1`
|
||||
|
||||
## [v1.7.1] - 2023-Feb-08
|
||||
1) Modified: Minor changes were made in the check_user_is_root() function in order to be more precise on user privileges when executing ishare2
|
||||
|
||||
## [v1.7.0] - 2023-Feb-04
|
||||
1) Modified: About `ishare2 upgrade` > `option 2`: Now, there are 2 stable versions of PNETLab available to use. Other releases were BETA type and they are not available anymore
|
||||
|
||||
## [v1.6.9] - 2023-Feb-04
|
||||
1) Modified: PNETLab version 5.3.11 changed state from BETA to STABLE. This upgrade can be implemented using this command: `ishare2 upgrade` > `option 2` and selecting the correspondant option
|
||||
|
||||
## [v1.6.8] - 2023-Feb-03
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.11 (Not possible for this case: 6.x to 5.3.11)
|
||||
|
||||
## [v1.6.7] - 2023-Feb-03
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.10 (Not possible for this case: 6.x to 5.3.10)
|
||||
|
||||
## [v1.6.6] - 2023-Feb-02
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.8 (Not possible for this case: 6.x to 5.3.8)
|
||||
|
||||
## [v1.6.5] - 2023-Feb-02
|
||||
1) Added: Now, menu `ishare2 upgrade` > `option 2` displays a message next to each version to distinguish between the STABLE and BETA versions of PNETLab
|
||||
|
||||
## [v1.6.4] - 2023-Feb-02
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.7 (Not possible for this case: 6.x to 5.3.7)
|
||||
|
||||
|
||||
72
README.md
72
README.md
@@ -10,22 +10,33 @@
|
||||
</h2>
|
||||
|
||||
## :hammer_and_wrench: Language
|
||||
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/bash/bash-original.svg" title="Bash" alt="Bash" width="40" height="40"/>
|
||||
</div>
|
||||
|
||||
## 🚀 Installation
|
||||
Apply this command using the terminal
|
||||
|
||||
There are two methods to install `ishare2` in your terminal. Choose one of the following options:
|
||||
|
||||
### wget
|
||||
|
||||
```linux
|
||||
wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2
|
||||
```
|
||||
|
||||
### curl
|
||||
|
||||
```linux
|
||||
curl -o /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2
|
||||
```
|
||||
|
||||
`Note: There is no need to be in the same directory where ishare2 file is installed in order to execute it`
|
||||
|
||||
## ✅ Syntax
|
||||
|
||||
|
||||
ishare2 [action] [param1] [param2]
|
||||
|
||||
|
||||
action:
|
||||
search : Search for images by type
|
||||
pull : Download an image by type and number
|
||||
@@ -37,16 +48,17 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
changelog : Show the latest changes made to ishare2
|
||||
gui : Web app to use ishare2 in browser
|
||||
help : Show useful information
|
||||
|
||||
|
||||
param1:
|
||||
type = all, bin, qemu, dynamips, docker or name
|
||||
|
||||
|
||||
param2:
|
||||
number = This number can be obtained using ishare2 search <type>
|
||||
|
||||
|
||||
## Examples of usage
|
||||
|
||||
## 💎 Search for images
|
||||
|
||||
- ishare2 search <type>
|
||||
- ishare2 search all
|
||||
- ishare2 search bin
|
||||
@@ -65,50 +77,59 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
- ishare2 search esxi
|
||||
- ishare2 search palo
|
||||
- ishare2 search Licensed
|
||||
|
||||
|
||||
`You can get more <name> options by using ishare2 search all`
|
||||
|
||||
## 💎 Pull images by number
|
||||
|
||||
- ishare2 pull bin <number>
|
||||
- ishare2 pull qemu <number>
|
||||
- ishare2 pull dynamips <number>
|
||||
|
||||
`<number> can be obtained by using ishare2 search <type>`
|
||||
|
||||
|
||||
## 💎 Pull all images at once
|
||||
|
||||
- ishare2 pull bin all
|
||||
- ishare2 pull qemu all (Not available for qemu type due to its large size)
|
||||
- ishare2 pull dynamips all
|
||||
|
||||
|
||||
## 💎 Show which images were installed
|
||||
|
||||
- ishare2 installed all
|
||||
- ishare2 installed bin
|
||||
- ishare2 installed qemu
|
||||
- ishare2 installed dynamips
|
||||
- ishare2 installed docker
|
||||
|
||||
|
||||
## 💎 Download every image available in a lab that was downloaded from [PNETLab Store](https://user.pnetlab.com/store/labs/view)
|
||||
|
||||
- ishare2 labs
|
||||
- ishare2 labs <number>
|
||||
- ishare2 labs all
|
||||
|
||||
`Not available to every lab because some of them were encrypted by authors and cannot be analyzed`
|
||||
|
||||
## 💎 Download every image available in a lab downloaded at a custom location in your server
|
||||
|
||||
- ishare2 mylabs <path>
|
||||
- ishare2 mylabs <path> <number>
|
||||
- ishare2 mylabs <path> all
|
||||
|
||||
## 💎 GUI
|
||||
|
||||
## 💎 GUI
|
||||
|
||||
- ishare2 gui download
|
||||
- ishare2 gui start
|
||||
- ishare2 gui stop
|
||||
- ishare2 gui restart
|
||||
|
||||
## 💎 Extras
|
||||
|
||||
- ishare2 relicense
|
||||
- ishare2 upgrade
|
||||
- ishare2 changelog
|
||||
- ishare2 help
|
||||
|
||||
|
||||
## Useful information
|
||||
|
||||
[HELP.md](https://github.com/pnetlabrepo/ishare2/blob/main/HELP.md)
|
||||
@@ -120,6 +141,7 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
## How to upgrade your PNETLab server
|
||||
|
||||
- Upgrade from v4.2.10 to v5.0.1: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_4.2.10_to_5.0.1)
|
||||
<!---
|
||||
- Upgrade from v4.2.10 to v5.2.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_4.2.10_to_5.2.7)
|
||||
- Upgrade from v5.0.1 to v5.2.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_5.0.1_to_5.2.7)
|
||||
- Upgrade from any to v5.2.8: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.2.8)
|
||||
@@ -129,29 +151,33 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
- Upgrade from any to v5.3.4: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.4)
|
||||
- Upgrade from any to v5.3.5: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.5)
|
||||
- Upgrade from any to v5.3.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.7)
|
||||
- Upgrade from any to v5.3.8: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.8)
|
||||
- Upgrade from any to v5.3.10: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.10)
|
||||
-->
|
||||
- Upgrade from any to v5.3.11: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.11)
|
||||
|
||||
Note: You can also upgrade PNETLab using `ishare2 upgrade`, then using the `option 2` and finally selecting an option from the displayed list
|
||||
|
||||
|
||||
## Known limitations
|
||||
|
||||
* Avoid to cancel a download in progress: (IN PROCESS TO FIX IT)
|
||||
- Avoid to cancel a download in progress: (IN PROCESS TO FIX IT)
|
||||
|
||||
If you cancel a download in progress, next time you try to download it you will not be allowed to do it because ishare2 will recognize it already exists in the server
|
||||
|
||||
In this case, you will have to manually remove it in order to be able to restart the download
|
||||
If you cancel a download in progress, next time you try to download it you will not be allowed to do it because ishare2 will recognize it already exists in the server
|
||||
|
||||
In this case, you will have to manually remove it in order to be able to restart the download
|
||||
|
||||
## ✨ Links
|
||||
|
||||
* qemu, bin and dynamips images can be found at [unetlab.cloud](https://unetlab.cloud/)
|
||||
* Docker images can be found at [hub.docker.com](https://hub.docker.com/)
|
||||
- qemu, bin and dynamips images can be found at [unetlab.cloud](https://unetlab.cloud/)
|
||||
- Docker images can be found at [hub.docker.com](https://hub.docker.com/)
|
||||
|
||||
## ✨ Useful resources
|
||||
|
||||
Check these links to get information on device credentials
|
||||
|
||||
* [Excel file #1: passwords_eve.xlsx](https://unetlab.cloud/UNETLAB%20I/addons/passwords/passwords_eve.xlsx)
|
||||
* [Excel file #2: Passwords - QEMU.xls](https://unetlab.cloud/UNETLAB%20II/Passwords%20-%20QEMU.xls)
|
||||
* [PNG file: Eve-NG-Linux.png](https://unetlab.cloud/UNETLAB%20II/qemu/Linux/Eve-NG-Linux/Eve-NG-Linux.png)
|
||||
- [Excel file #1: passwords_eve.xlsx](https://unetlab.cloud/UNETLAB%20I/addons/passwords/passwords_eve.xlsx)
|
||||
- [Excel file #2: Passwords - QEMU.xls](https://unetlab.cloud/UNETLAB%20II/Passwords%20-%20QEMU.xls)
|
||||
- [PNG file: Eve-NG-Linux.png](https://unetlab.cloud/UNETLAB%20II/qemu/Linux/Eve-NG-Linux/Eve-NG-Linux.png)
|
||||
|
||||
## ❓Need help?
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# Changelog for ishare2 GUI
|
||||
All notable changes to this project will be documented in this file. You can upgrade ishare2 GUI to the latest version using `ishare2 upgrade` and then selecting `option 3`
|
||||
|
||||
## [v1.0.4] - 2023-Feb-02
|
||||
1) Modified: In this version, when a user looks for installed images, those images are now displayed with correspondant IDs and not with a table starting from 1. This was not causing any bug in previous versions. This upgrade just shows a precise version of installed image IDs. Also, Size and Unit columns were added in order to display more information. It applies to bin, dynamips and qemu searches
|
||||
|
||||
## [v1.0.3] - 2023-Feb-02
|
||||
1) Modified: A bug related to search field was solved. This bug was not retrieving the correct id for every match causing wrong downloads. It applies to bin, dynamips and qemu searches
|
||||
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
## ishare2 GUI
|
||||
# ishare2 GUI
|
||||
|
||||
## Download
|
||||
|
||||
### Download
|
||||
Apply this command to download and implement GUI into your PNETLab VM
|
||||
|
||||
```linux
|
||||
ishare2 gui download
|
||||
```
|
||||
|
||||
### Start
|
||||
## Start
|
||||
|
||||
Apply this command to start the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui start
|
||||
```
|
||||
|
||||
Once finished, go to:
|
||||
`http://localhost:5000`,
|
||||
`http://127.0.0.1:5000` or
|
||||
`http://pnetlab_ip_address:5000`
|
||||
|
||||
### Stop
|
||||
## Stop
|
||||
|
||||
Apply this command to stop the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui stop
|
||||
```
|
||||
|
||||
### Restart
|
||||
## Restart
|
||||
|
||||
Apply this command to restart the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui restart
|
||||
```
|
||||
|
||||
BIN
gui/app.zip
BIN
gui/app.zip
Binary file not shown.
@@ -1 +1 @@
|
||||
v1.0.3
|
||||
v1.0.4
|
||||
|
||||
91
ishare2
91
ishare2
@@ -20,24 +20,27 @@ function set_url_constants() {
|
||||
URL_C2600_YML=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/templates/cisco/c2600.yml
|
||||
URL_C1760_YML=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/templates/cisco/c1760.yml
|
||||
URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_0_1=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_5.0.1/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_2_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_5.2.7/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_5_0_1_TO_5_2_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_5.0.1_to_5.2.7/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_8=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.8/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_9=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.9/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_0=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.0/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_2=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.2/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_4=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.4/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_5=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.5/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.7/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_2_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_5.2.7/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_5_0_1_TO_5_2_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_5.0.1_to_5.2.7/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_8=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.8/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_9=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.9/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_0=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.0/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_2=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.2/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_4=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.4/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_5=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.5/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_7=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.7/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_8=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.8/upgrade.sh
|
||||
#URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_10=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.10/upgrade.sh
|
||||
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_11=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.11/upgrade.sh
|
||||
URL_GUI_APP_ZIP=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/gui/app.zip
|
||||
URL_REQUIREMENTS_GUI_APP=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/gui/requirements.txt
|
||||
URL_ISHARE2_GUI_VERSION=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/gui/version_gui
|
||||
}
|
||||
|
||||
function check_user_is_root() {
|
||||
user=$(whoami)
|
||||
if [[ "$user" != "root" ]]; then
|
||||
echo -e "${RED}[!] Current user ($user) is not root, please change user as root to execute this script${NO_COLOR}"
|
||||
if ! [[ "$(id -u)" == 0 ]]; then
|
||||
user=$(whoami)
|
||||
echo -e "${RED}[!] This script requires root privileges to be executed. The current user, "$user", does not have enough permissions. Please, switch to the root user to run the script.${NO_COLOR}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
@@ -968,16 +971,8 @@ function upgrade_ishare2() {
|
||||
function menu_ishare2_upgrade_pnetlab() {
|
||||
prompt="Please, select an option: "
|
||||
options=(
|
||||
"Upgrade PNETLab: from 4.2.10 to 5.0.1"
|
||||
"Upgrade PNETLab: from 4.2.10 to 5.2.7"
|
||||
"Upgrade PNETLab: from 5.0.1 to 5.2.7"
|
||||
"Upgrade PNETLab: from any version to 5.2.8"
|
||||
"Upgrade PNETLab: from any version to 5.2.9"
|
||||
"Upgrade PNETLab: from any version to 5.3.0"
|
||||
"Upgrade PNETLab: from any version to 5.3.2"
|
||||
"Upgrade PNETLab: from any version to 5.3.4"
|
||||
"Upgrade PNETLab: from any version to 5.3.5"
|
||||
"Upgrade PNETLab: from any version to 5.3.7"
|
||||
"(STABLE) Upgrade PNETLab: from 4.2.10 to 5.0.1"
|
||||
"(STABLE) Upgrade PNETLab: from any version to 5.3.11"
|
||||
)
|
||||
|
||||
PS3="$prompt"
|
||||
@@ -990,55 +985,7 @@ function menu_ishare2_upgrade_pnetlab() {
|
||||
break
|
||||
;;
|
||||
2)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_2_7 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
3)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_5_0_1_TO_5_2_7 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
4)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_8 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
5)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_9 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
6)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_0 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
7)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_2 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
8)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_4 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
9)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_5 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
;;
|
||||
10)
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_7 > /dev/null 2>&1
|
||||
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_11 > /dev/null 2>&1
|
||||
chmod +x upgrade.sh
|
||||
bash upgrade.sh
|
||||
break
|
||||
@@ -1047,7 +994,7 @@ function menu_ishare2_upgrade_pnetlab() {
|
||||
break
|
||||
;;
|
||||
*)
|
||||
STR="Invalid option: Select a number from 1 to 11"
|
||||
STR="Invalid option: Select a number from 1 to 3"
|
||||
echo -e "${RED}$STR${NO_COLOR}"
|
||||
continue
|
||||
;;
|
||||
|
||||
19
upgrades/extras/upgrade_ubuntu_to_20.04/README.md
Normal file
19
upgrades/extras/upgrade_ubuntu_to_20.04/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```linux
|
||||
This script allows to upgrade dependencies in PNETLab UBUNTU 20.04
|
||||
|
||||
File pnetlabv6_offline.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
`This script cannot be used in cases where PNETLab UBUNTU version is not 20.04: For those cases, an error message will be displayed and the script execution will be finished`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
When you run this command from above, the steps will be executed as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be applied to this file
|
||||
3) Finally, this script will be executed in order to make the upgrade
|
||||
48
upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh
Normal file
48
upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade dependencies in PNETLab UBUNTU 20.04
|
||||
# Requirement: You need to have UBUNTU 20.04
|
||||
|
||||
# CONSTANTS
|
||||
GREEN='\033[32m'
|
||||
RED='\033[31m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
ZIP_FILENAME=pnetlabv6_offline.zip
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/upgrade_to_ubuntu_20.04/pnetlabv6_offline.zip
|
||||
|
||||
lsb_release -r -s | grep -q 20.04
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}Upgrade has been rejected. You need to have UBUNTU 20.04 to use this script${NO_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $ZIP_FILENAME...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /tmp/$ZIP_FILENAME $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$ZIP_FILENAME has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /tmp && rm -rf upgrade
|
||||
|
||||
apt-get update > /dev/null 2>&1
|
||||
apt-get install unzip > /dev/null 2>&1
|
||||
apt-get purge -y docker.io containerd runc netplan.io &> /dev/null
|
||||
apt-get autoremove &> /dev/null
|
||||
apt-get autoclean &> /dev/null
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $ZIP_FILENAME -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Executing upgrade script...${NO_COLOR}"
|
||||
./upgrade/install_pnetlab_v6_offline.sh
|
||||
echo -e "${GREEN}Upgrade has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
rm /tmp/$ZIP_FILENAME
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute with these credentials: username=root password=pnet${NO_COLOR}"
|
||||
reboot
|
||||
27
upgrades/from_any_to_5.3.10/README.md
Normal file
27
upgrades/from_any_to_5.3.10/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```linux
|
||||
This script allows to upgrade PNETLab from almost any version to v5.3.10
|
||||
It cannot be used when version is 6.x
|
||||
|
||||
File 5.3.10.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
|
||||
`This script cannot be used in cases where PNETLab version is 6.x: An error message will be displayed and the script execution will be finished`
|
||||
|
||||
`Also, this script detects if you already have PNETLab v5.3.10 in your system and avoids to upgrade twice`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.10/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
After a few seconds, the upgrade will be done.
|
||||
|
||||
Note: This upgrade does not use ishare2:
|
||||
|
||||
When you execute the command from above, the steps are as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.10/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be made to this file
|
||||
3) This script will be executed in order to make the upgrade
|
||||
50
upgrades/from_any_to_5.3.10/upgrade.sh
Normal file
50
upgrades/from_any_to_5.3.10/upgrade.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade PNETLab from almost any version to NEW_PNETLAB_VERSION version
|
||||
# Requirement: Not having PNETLab 6.x installed for being able to upgrade to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.3.10
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
|
||||
# Getting PNETLab version from db
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
pnetlab_info=($data)
|
||||
pnetlab_version=${pnetlab_info[1]}
|
||||
|
||||
if [[ $pnetlab_version == $NEW_PNETLAB_VERSION ]]; then
|
||||
echo "PNETLab already upgraded to v$NEW_PNETLAB_VERSION. You can´t upgrade twice"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
echo "It is not possible to upgrade to $NEW_PNETLAB_VERSION having version 6.x"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /root && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Upgrading to v$NEW_PNETLAB_VERSION...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
#rm $NEW_PNETLAB_VERSION.zip
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
|
||||
reboot
|
||||
27
upgrades/from_any_to_5.3.11/README.md
Normal file
27
upgrades/from_any_to_5.3.11/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```linux
|
||||
This script allows to upgrade PNETLab from almost any version to v5.3.11
|
||||
It cannot be used when version is 6.x
|
||||
|
||||
File 5.3.11.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
|
||||
`This script cannot be used in cases where PNETLab version is 6.x: An error message will be displayed and the script execution will be finished`
|
||||
|
||||
`Also, this script detects if you already have PNETLab v5.3.11 in your system and avoids to upgrade twice`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.11/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
After a few seconds, the upgrade will be done.
|
||||
|
||||
Note: This upgrade does not use ishare2:
|
||||
|
||||
When you execute the command from above, the steps are as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.11/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be made to this file
|
||||
3) This script will be executed in order to make the upgrade
|
||||
50
upgrades/from_any_to_5.3.11/upgrade.sh
Normal file
50
upgrades/from_any_to_5.3.11/upgrade.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade PNETLab from almost any version to NEW_PNETLAB_VERSION version
|
||||
# Requirement: Not having PNETLab 6.x installed for being able to upgrade to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.3.11
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
|
||||
# Getting PNETLab version from db
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
pnetlab_info=($data)
|
||||
pnetlab_version=${pnetlab_info[1]}
|
||||
|
||||
if [[ $pnetlab_version == $NEW_PNETLAB_VERSION ]]; then
|
||||
echo "PNETLab already upgraded to v$NEW_PNETLAB_VERSION. You can´t upgrade twice"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
echo "It is not possible to upgrade to $NEW_PNETLAB_VERSION having version 6.x"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /root && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Upgrading to v$NEW_PNETLAB_VERSION...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
#rm $NEW_PNETLAB_VERSION.zip
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
|
||||
reboot
|
||||
27
upgrades/from_any_to_5.3.8/README.md
Normal file
27
upgrades/from_any_to_5.3.8/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```linux
|
||||
This script allows to upgrade PNETLab from almost any version to v5.3.8
|
||||
It cannot be used when version is 6.x
|
||||
|
||||
File 5.3.8.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
|
||||
`This script cannot be used in cases where PNETLab version is 6.x: An error message will be displayed and the script execution will be finished`
|
||||
|
||||
`Also, this script detects if you already have PNETLab v5.3.8 in your system and avoids to upgrade twice`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.8/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
After a few seconds, the upgrade will be done.
|
||||
|
||||
Note: This upgrade does not use ishare2:
|
||||
|
||||
When you execute the command from above, the steps are as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.8/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be made to this file
|
||||
3) This script will be executed in order to make the upgrade
|
||||
50
upgrades/from_any_to_5.3.8/upgrade.sh
Normal file
50
upgrades/from_any_to_5.3.8/upgrade.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade PNETLab from almost any version to NEW_PNETLAB_VERSION version
|
||||
# Requirement: Not having PNETLab 6.x installed for being able to upgrade to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.3.8
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
|
||||
# Getting PNETLab version from db
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
pnetlab_info=($data)
|
||||
pnetlab_version=${pnetlab_info[1]}
|
||||
|
||||
if [[ $pnetlab_version == $NEW_PNETLAB_VERSION ]]; then
|
||||
echo "PNETLab already upgraded to v$NEW_PNETLAB_VERSION. You can´t upgrade twice"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
echo "It is not possible to upgrade to $NEW_PNETLAB_VERSION having version 6.x"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /root && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Upgrading to v$NEW_PNETLAB_VERSION...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
#rm $NEW_PNETLAB_VERSION.zip
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
|
||||
reboot
|
||||
Reference in New Issue
Block a user