18 Commits

Author SHA1 Message Date
Alex
1388de005f added 4th addition 2023-03-05 20:17:58 -06:00
Alex
4ee607479a Ask to confirm before rebooting 2023-03-05 20:16:30 -06:00
Alex
dc77d56999 version bump 2023-03-05 20:10:03 -06:00
Alex
d0dd22e5ea v1.7.4 version changelogs 2023-03-05 20:09:47 -06:00
Alex
6d773c6b31 Fixed broken links 2023-03-05 20:06:59 -06:00
Alex
62335c3573 Preventing issues when downloading scripts 2023-03-05 01:08:38 -06:00
Alex
ba79494401 Merge branch 'main' of https://github.com/pnetlabrepo/ishare2 2023-02-23 16:36:20 -06:00
Alex
c46bc33d3d Added new upgrade option to ishare2 2023-02-23 16:34:17 -06:00
Alex
48a851217f Added new upgrade option in changelog 2023-02-23 16:33:38 -06:00
Alex
cc8e394a39 Version bump 2023-02-23 16:33:10 -06:00
Alex
1f6bc36ef0 Merge pull request #4 from pnetlabrepo/beta
Added miscelaneous word fixing, and extra information as steps in the script are being executed
2023-02-23 12:44:07 -06:00
Alex
2a2db4c7cb Misc wording fixes, error handling and echoing extra status info 2023-02-21 22:00:08 -06:00
Alex
ccb5955048 Added timer before abruply rebooting the VM 2023-02-21 21:58:24 -06:00
Alex
2679bebde4 Check if script is running as root 2023-02-21 21:56:34 -06:00
pnetlabrepo
9c9196de83 Update ishare2 2023-02-20 17:48:47 -03:00
pnetlabrepo
f90838116a Update requirements.txt 2023-02-20 17:48:01 -03:00
Alex
2e43be361e Double quote to prevent globbing and word splitting 2023-02-14 12:07:37 -06:00
pnetlabrepo
9d837c2ebc Update CHANGELOG.md 2023-02-14 11:21:18 -03:00
17 changed files with 194 additions and 109 deletions

View File

@@ -2,9 +2,19 @@
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.4] - 2023-Mar-05
1) Fixed: Broken links for ishare2 upgrade menu.
2) Prevent broken links for ishare2 upgrade menu.
3) Added: Reboot confirmation to upgrade scripts.
## [v1.7.3] - 2023-Feb-23
1) Added: New upgrade option in upgrade menu: 3) (UNSTABLE) Upgrade to PNETLab 6 (ONLY AVAILABLE FOR UBUNTU 20.04). This will install PNetLab 6 on your VM. It is only supported on Ubuntu 20.04.
## [v1.7.2] - 2023-Feb-12
1) Added: `--overwrite` flag. Users can specify they want to overwrite an image by passing this 4th argument. Useful when download gets interrupted or you want to restore it to the initial state. Syntax: `ishare pull <type> <id> --overwrite`
1) Added: `--overwrite` flag. Users can specify they want to overwrite an image by passing this 4th argument. Useful when download gets interrupted or you want to restore it to the initial state. Syntax: `ishare2 pull <type> <id> --overwrite`
## [v1.7.1] - 2023-Feb-08

View File

@@ -14,7 +14,7 @@ contextvars==2.4
cryptography==2.1.4
dataclasses==0.8
distro-info===0.18ubuntu0.18.04.1
fastapi==0.83.0
fastapi<=0.83.0
h11==0.13.0
httplib2==0.9.2
hyperlink==17.3.1
@@ -22,7 +22,7 @@ idna==3.4
immutables==0.19
importlib-metadata==4.8.3
incremental==16.10.1
Jinja2==2.10
Jinja2<=2.10
jsonpatch==1.16
jsonpointer==1.10
jsonschema==2.6.0
@@ -55,7 +55,7 @@ typing_extensions==4.1.1
ufw==0.36
unattended-upgrades==0.1
urllib3==1.22
uvicorn==0.16.0
uvicorn<=0.16.0
uvloop==0.14.0
watchgod==0.7
websockets==9.1

20
ishare2
View File

@@ -32,6 +32,7 @@ function set_url_constants() {
#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_UPGRADE_PNETLAB6_INSTALLER='https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/Focal/install_pnetlab_v6.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
@@ -955,19 +956,26 @@ function menu_ishare2_upgrade_pnetlab() {
options=(
"(STABLE) Upgrade PNETLab: from 4.2.10 to 5.0.1"
"(STABLE) Upgrade PNETLab: from any version to 5.3.11"
"(UNSTABLE) Upgrade to / Install PNETLab 6 (ONLY AVAILABLE FOR UBUNTU 20.04)"
)
PS3="$prompt"
select opt in "${options[@]}" "Exit"; do
case "$REPLY" in
1)
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_0_1 >/dev/null 2>&1
wget -O upgrade.sh "$URL_UPGRADE_PNETLAB_FROM_4_2_10_TO_5_0_1"
chmod +x upgrade.sh
bash upgrade.sh
break
;;
2)
wget -O upgrade.sh $URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_11 >/dev/null 2>&1
wget -O upgrade.sh "$URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_11"
chmod +x upgrade.sh
bash upgrade.sh
break
;;
3)
wget --content-disposition -q --show-progress -O upgrade.sh "$URL_UPGRADE_PNETLAB6_INSTALLER"
chmod +x upgrade.sh
bash upgrade.sh
break
@@ -1046,9 +1054,9 @@ function ishare2_gui_download() {
wget -q $URL_REQUIREMENTS_GUI_APP -P /root
pip install -r /root/requirements.txt >/dev/null 2>&1
pip install uvicorn >/dev/null 2>&1
pip install fastapi >/dev/null 2>&1
pip install jinja2 >/dev/null 2>&1
#pip install uvicorn >/dev/null 2>&1
#pip install fastapi >/dev/null 2>&1
#pip install jinja2 >/dev/null 2>&1
rm /root/requirements.txt
@@ -2251,7 +2259,7 @@ function main() {
set_yml_template_folder_location
check_ishare2_version_file_exists
check_ishare2_gui_version_file_exists
selector $1 $2 $3 $4
selector "$1" "$2" "$3" "$4"
}
main $@

View File

@@ -9,40 +9,58 @@ 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
URL_ZIP_FILE='https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/upgrade_to_ubuntu_20.04/pnetlabv6_offline.zip'
# Check if user is root
if [ "$(id -u)" != "0" ]; then
echo -e "${RED}Upgrade has been rejected. You must run this script as root${NO_COLOR}"
exit 0
fi
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}"
echo -e "${RED}Upgrade has been rejected. You must be running UBUNTU 20.04 to run 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
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
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}"
echo -e "${GREEN}Unzipping $ZIP_FILENAME (this may take a while)...${NO_COLOR}"
unzip $ZIP_FILENAME -d ./upgrade >/dev/null 2>&1
echo -e "${GREEN}$ZIP_FILENAME has been unzipped successfully...${NO_COLOR}"
echo -e "${GREEN}Changing permissions...${NO_COLOR}"
chmod 755 -R upgrade
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
echo -e "${GREEN}Permissions have been changed successfully${NO_COLOR}"
echo -e "${GREEN}Converting files to unix format...${NO_COLOR}"
find upgrade -type f -print0 | xargs -0 dos2unix >/dev/null 2>&1
echo -e "${GREEN}Files have been converted to unix format successfully${NO_COLOR}"
echo -e "${GREEN}Executing upgrade script...${NO_COLOR}"
./upgrade/install_pnetlab_v6_offline.sh
echo -e "${GREEN}Upgrade has been done successfully${NO_COLOR}"
if [ $? -ne 0 ]; then
echo -e "${RED}Upgrade has been rejected. Something went wrong${NO_COLOR}"
exit 0
fi
echo -e "${GREEN}Upgrade has been done successfully!${NO_COLOR}"
echo -e "${GREEN}Cleaning up...${NO_COLOR}"
rm -rf upgrade
rm /tmp/$ZIP_FILENAME
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
echo -e "${GREEN}PNETLab VM will be rebooted in 10 seconds (press CTRL+C to cancel)...${NO_COLOR}"
echo -e "${GREEN}Try to connect again in about a minute with these credentials: username=root password=pnet${NO_COLOR}"
sleep 10
echo -e "${GREEN}Rebooting...${NO_COLOR}"
reboot

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.2.7
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_4.2.10_to_5.2.7/5.2.7.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_4.2.10_to_5.2.7/5.2.7.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)
@@ -24,7 +24,7 @@ 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
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.2.7
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_5.0.1_to_5.2.7/5.2.7.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_5.0.1_to_5.2.7/5.2.7.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)
@@ -24,7 +24,7 @@ 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
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,11 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.2.8
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_5.2.8/5.2.8.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_any_to_5.2.8/5.2.8.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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.2.9
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_5.2.9/5.2.9.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_any_to_5.2.9/5.2.9.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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.3.0
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_5.3.0/5.3.0.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_any_to_5.3.0/5.3.0.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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.3.2
GREEN='\033[32m'
NO_COLOR='\033[0m'
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_5.3.2/5.3.2.zip
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/from_any_to_5.3.2/5.3.2.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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.3.4
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.3.5
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
NEW_PNETLAB_VERSION=5.3.7
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -8,7 +8,7 @@
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
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/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)
@@ -24,7 +24,7 @@ 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}"
@@ -32,11 +32,11 @@ echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully$
cd /root && rm -rf upgrade
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
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
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
@@ -45,6 +45,10 @@ echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO
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
# confirm reboot
echo -e "${GREEN}Do you want to reboot now? [y/n]${NO_COLOR}"
read -r answer
if [[ $answer == "y" ]]; then
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
reboot
fi

View File

@@ -1 +1 @@
v1.7.2
v1.7.4