25 Commits

Author SHA1 Message Date
pnetlabrepo
0d7f657da3 Update version 2023-02-04 18:26:38 -03:00
pnetlabrepo
0ac03ebd21 Update CHANGELOG.md 2023-02-04 18:25:11 -03:00
pnetlabrepo
d790829821 Update ishare2 2023-02-04 18:23:31 -03:00
pnetlabrepo
c103cc113e Update README.md 2023-02-04 18:15:46 -03:00
pnetlabrepo
08691fccc4 Update CHANGELOG.md 2023-02-04 02:00:18 -03:00
pnetlabrepo
319fbae448 Update version 2023-02-04 01:58:24 -03:00
pnetlabrepo
f8a079eb6c Update ishare2 2023-02-04 01:58:14 -03:00
pnetlabrepo
f0a58090f6 Update CHANGELOG.md 2023-02-03 23:21:54 -03:00
pnetlabrepo
45c64b1372 Update version 2023-02-03 23:21:17 -03:00
pnetlabrepo
30b3a134a9 Update ishare2 2023-02-03 23:21:02 -03:00
pnetlabrepo
4cb7b35521 Update README.md 2023-02-03 23:18:25 -03:00
pnetlabrepo
ce6685b105 Create upgrade.sh 2023-02-03 23:17:55 -03:00
pnetlabrepo
7225126a8f Create README.md 2023-02-03 23:17:35 -03:00
pnetlabrepo
ec41f3a2b4 Update CHANGELOG.md 2023-02-03 16:40:07 -03:00
pnetlabrepo
4dd5627635 Update version 2023-02-03 16:39:31 -03:00
pnetlabrepo
8a52d7b2f2 Update ishare2 2023-02-03 16:39:16 -03:00
pnetlabrepo
23f62982e6 Update README.md 2023-02-03 16:37:30 -03:00
pnetlabrepo
14866d70ed Create upgrade.sh 2023-02-03 16:36:26 -03:00
pnetlabrepo
f4922f9f7b Create README.md 2023-02-03 16:35:54 -03:00
pnetlabrepo
9c0e359c25 Update CHANGELOG.md 2023-02-02 20:46:11 -03:00
pnetlabrepo
7449b13936 Update version 2023-02-02 20:45:30 -03:00
pnetlabrepo
3a0f248be0 Update ishare2 2023-02-02 20:45:20 -03:00
pnetlabrepo
0ae280bbe7 Update README.md 2023-02-02 20:43:37 -03:00
pnetlabrepo
dbef7e8e34 Create upgrade.sh 2023-02-02 20:42:36 -03:00
pnetlabrepo
4740a21549 Create README.md 2023-02-02 20:41:53 -03:00
10 changed files with 267 additions and 69 deletions

View File

@@ -1,6 +1,21 @@
# 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.0] - 2023-Feb-04
1) Modified: About `ishare2 upgrade` > `option 2`: Now, there are 2 stable versions of PNETLab available to use. Other release were BETA and not available any more
## [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

View File

@@ -120,6 +120,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,6 +130,10 @@ 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

83
ishare2
View File

@@ -20,15 +20,18 @@ 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
@@ -969,15 +972,7 @@ function menu_ishare2_upgrade_pnetlab() {
prompt="Please, select an option: "
options=(
"(STABLE) Upgrade PNETLab: from 4.2.10 to 5.0.1"
"(BETA) Upgrade PNETLab: from 4.2.10 to 5.2.7"
"(BETA) Upgrade PNETLab: from 5.0.1 to 5.2.7"
"(BETA) Upgrade PNETLab: from any version to 5.2.8"
"(BETA) Upgrade PNETLab: from any version to 5.2.9"
"(BETA) Upgrade PNETLab: from any version to 5.3.0"
"(BETA) Upgrade PNETLab: from any version to 5.3.2"
"(BETA) Upgrade PNETLab: from any version to 5.3.4"
"(BETA) Upgrade PNETLab: from any version to 5.3.5"
"(BETA) Upgrade PNETLab: from any version to 5.3.7"
"(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
;;

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -1 +1 @@
v1.6.5
v1.7.0