Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b73156b1c | ||
|
|
e5da554158 | ||
|
|
e7492cbf67 | ||
|
|
6d9f45b56b | ||
|
|
89b8e808ed | ||
|
|
c61e8398e4 | ||
|
|
27a7e2de7b | ||
|
|
c76b832ac6 | ||
|
|
bfd2377c8a | ||
|
|
3064fdcab2 | ||
|
|
3503add54c | ||
|
|
cab7df20ff | ||
|
|
1b30909d0b | ||
|
|
71e9cae4fa | ||
|
|
dbe22ff781 |
@@ -1,6 +1,10 @@
|
||||
# Changelog
|
||||
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.4.9] - 2023-Jan-19
|
||||
|
||||
1) Added: This version adds support to PNETLab 6.x related to templates location (AMD and Intel folder locations)
|
||||
|
||||
## [v1.4.8] - 2023-Jan-17
|
||||
|
||||
1) Added: A menu was added into the `ishare2 upgrade` command. This menu allows users to upgrade ishare2 and PNETLab to their latest versions
|
||||
|
||||
@@ -18,7 +18,7 @@ Apply this command using the terminal
|
||||
wget -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
|
||||
`Note: There is no need to be in the same directory where ishare2 file is installed in order to execute it`
|
||||
|
||||
## ✅ Syntax
|
||||
|
||||
@@ -123,7 +123,7 @@ Note: There is no need to be in the same directory where *ishare2* file is insta
|
||||
- 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)
|
||||
|
||||
Note: You can also upgrade PNETLab using `ishare2 upgrade`, then selecting option 2 and finally one more option from the list
|
||||
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
|
||||
|
||||
|
||||
24
ishare2
24
ishare2
@@ -48,6 +48,16 @@ function get_initial_information() {
|
||||
DYNAMIPS_URL=$URL_PREFIX$DYNAMIPS_GID$URL_POSTFIX
|
||||
}
|
||||
|
||||
function get_server_platform() {
|
||||
grep -q vmx /proc/cpuinfo && echo -n vmx > /opt/unetlab/platform
|
||||
grep -q svm /proc/cpuinfo && echo -n svm > /opt/unetlab/platform
|
||||
|
||||
platform=$(cat /opt/unetlab/platform)
|
||||
|
||||
if [[ $platform == "vmx" ]]; then YML_DIR="/opt/unetlab/html/templates/intel/" ; fi
|
||||
if [[ $platform == "svm" ]]; then YML_DIR="/opt/unetlab/html/templates/amd/" ; fi
|
||||
}
|
||||
|
||||
function set_yml_template_folder_location() {
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
data_array=($data)
|
||||
@@ -56,13 +66,11 @@ function set_yml_template_folder_location() {
|
||||
if [[ $pnetlab_version == "4.2.10" ]]; then YML_DIR="/opt/unetlab/html/templates/" ; fi
|
||||
|
||||
if [[ $pnetlab_version == "5.2.5" ]] || [[ $pnetlab_version == "5.2.6" ]] || [[ $pnetlab_version == "5.2.7" ]]; then
|
||||
grep -q vmx /proc/cpuinfo && echo -n vmx > /opt/unetlab/platform
|
||||
grep -q svm /proc/cpuinfo && echo -n svm > /opt/unetlab/platform
|
||||
|
||||
platform=$(cat /opt/unetlab/platform)
|
||||
|
||||
if [[ $platform == "vmx" ]]; then YML_DIR="/opt/unetlab/html/templates/intel/" ; fi
|
||||
if [[ $platform == "svm" ]]; then YML_DIR="/opt/unetlab/html/templates/amd/" ; fi
|
||||
get_server_platform
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
get_server_platform
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1304,7 +1312,7 @@ function show_help_info() {
|
||||
echo -e "1) For problems, use our Telegram Channel describing your problem and sending a screenshot and/or a video"
|
||||
echo -e "\n2) For new files to be uploaded, you can use our Telegram Channel too"
|
||||
echo -e "In this case, you can send or ask for new images to be uploaded"
|
||||
echo -e "\n3) Using \033[32mishare2 upgrade\033[0m will result in upgrading this utility (ishare2). It will \033[31mnot\033[0m upgrade your PNETLab Ubuntu VM version"
|
||||
echo -e "\n3) Using \033[32mishare2 upgrade\033[0m will display a menu that allows users to upgrade ishare2 and PNETLab."
|
||||
echo -e "\n4) If CiscoIOUKeygen.py, iourc and/or keepalive.pl files in /opt/unetlab/addons/iol/bin/ are deleted, you can recover them by using \033[32mishare2 relicense\033[0m. This will not affect images in there."
|
||||
echo -e "Also, this command when used, will generate a new license file called iourc, needed for bin files"
|
||||
echo -e "\n5) Don't cancell a download. In case you do it, you will have to remove incomplete files or folders manually"
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
# Requirement: Having PNETLab 4.2.10 installed for being able to upgrade it to 5.0.1
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_5.0.1/5.0.1.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]}
|
||||
@@ -18,13 +24,22 @@ if ! [[ $pnetlab_version == "4.2.10" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Upgrading to v5.0.1"
|
||||
wget -O /tmp/5.0.1.zip https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_5.0.1/5.0.1.zip > /dev/null 2>&1
|
||||
cd /tmp
|
||||
rm -rf upgrade
|
||||
echo -e "${GREEN}Downloading 5.0.1.zip file...${NO_COLOR}"
|
||||
wget -O /tmp/5.0.1.zip $URL_ZIP_FILE > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /tmp && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip 5.0.1.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 v5.0.1...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v5.0.1 has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
rm 5.0.1.zip
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
# Requirement: Having PNETLab 4.2.10 installed for being able to upgrade it to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.2.7
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_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]}
|
||||
@@ -19,22 +24,27 @@ if ! [[ $pnetlab_version == "4.2.10" ]]; then
|
||||
echo "You need to have the v4.2.10 to upgrade to the v$NEW_PNETLAB_VERSION"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_4.2.10_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
wget -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
|
||||
|
||||
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 now${NO_COLOR}"
|
||||
|
||||
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
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
# Requirement: Having PNETLab 5.0.1 installed for being able to upgrade it to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.2.7
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_5.0.1_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]}
|
||||
@@ -19,22 +24,27 @@ if ! [[ $pnetlab_version == "5.0.1" ]]; then
|
||||
echo "You need to have the v5.0.1 to upgrade to the v$NEW_PNETLAB_VERSION"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_5.0.1_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
wget -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
|
||||
|
||||
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 now${NO_COLOR}"
|
||||
|
||||
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