hetzneronline / installimage

Bash scripts to universally deploy various distributions
Other
517 stars 143 forks source link

Fix syntax errors with custom installs #65

Closed stickz closed 11 months ago

stickz commented 1 year ago

This commit gracefully fixes syntax errors for custom installations. It allows the install image script to continue as expected.

1) Fixed a bug with image version string. If the image file doesn't have a version, gracefully set it to 0. 2) Fixed a bug with the debian_version file not being present. If it doesn't exist, gracefully set the debian version to 0.

I tested this on my hetzner dedicated server inside the rescue system. It works as expected. I created a testing environment to successfully do this.

Side Note: cut -d "-" -f 2 will not cut anything, if the image file doesn't contain a version. I checked for the tar keyword to determine this. I used a wildcard that will work more frequently. Checking h.net.tar.gz is no longer required.

asciiprod commented 11 months ago

Please use the correct naming scheme for your images. This code path is likely to be removed soonish. https://docs.hetzner.com/robot/dedicated-server/operating-systems/installing-custom-images/#install-older-linux-images-using-the-installimage-script