fixed some shell bugs

This commit is contained in:
Xatrekak 2023-02-11 23:24:23 -05:00
parent 3b0336bd7e
commit 952b4e7249
2 changed files with 11 additions and 6 deletions

View File

@ -164,7 +164,7 @@ apt-get install -y gns3-server
log "Create user GNS3 with /opt/gns3 as home directory"
if [ ! -d "/opt/gns3/" ]
then
useradd -d /opt/gns3/ -m gns3
useradd -m -d /opt/gns3/ gns3
fi
@ -303,10 +303,11 @@ log "GNS3 installed with success"
if [ $WELCOME_SETUP == 1 ]
then
apt-get install -y net-tools
NEEDRESTART_MODE=a apt-get install -y net-tools
NEEDRESTART_MODE=a apt-get install -y python3-pip
NEEDRESTART_MODE=a pip install --no-input --upgrade pip
NEEDRESTART_MODE=a pip install --no-input pythondialog
NEEDRESTART_MODE=a apt-get install -y dialog
pip install --no-input --upgrade pip
pip install --no-input pythondialog
curl https://raw.githubusercontent.com/Xatrekak/gns3-server/remote_install_changes/scripts/welcome.py > /usr/local/bin/welcome.py
@ -324,6 +325,7 @@ chmod 755 /etc/systemd/system/getty@tty1.service.d/override.conf
chown root:root /etc/systemd/system/getty@tty1.service.d/override.conf
echo "python3 /usr/local/bin/welcome.py" >> /opt/gns3/.bashrc
usermod --shell /bin/bash gns3
fi

View File

@ -107,8 +107,11 @@ def gns3vm_version():
"""
Return the GNS3 VM version
"""
with open('/home/gns3/.config/GNS3/gns3vm_version') as f:
return f.read().strip()
try:
with open('/home/gns3/.config/GNS3/gns3vm_version') as f:
return f.read().strip()
except FileNotFoundError:
return "Remote Install"
d = Dialog(dialog="dialog", autowidgetsize=True)