Skip to content
This repository has been archived by the owner on Mar 7, 2020. It is now read-only.

Install-Skript bei kritischen Fehlern stoppen #26

Open
ploebb opened this issue Apr 4, 2016 · 2 comments
Open

Install-Skript bei kritischen Fehlern stoppen #26

ploebb opened this issue Apr 4, 2016 · 2 comments
Milestone

Comments

@ploebb
Copy link
Collaborator

ploebb commented Apr 4, 2016

z.B. wenn das git-repo nicht geladen werden kann oder zu wenig Speicherplatz ist.

Ich würde öfter mal ein || exit hinter wichtige commands setzen. Oder eine elegantere Lösung?

Mit set -e am Anfang des Skripts wird abgebrochen, wenn einer der commands fehlschlägt. Ist vielleicht ein bisschen krass (Problem z.B. beim user Anlegen wenn schon existiert?)

@hobbyquaker
Copy link
Owner

guter Punkt! Ich mach mir mal Gedanken dazu

@hobbyquaker hobbyquaker added this to the 1.0.0 milestone Apr 6, 2016
@leonsio
Copy link

leonsio commented May 24, 2016

Ich würde zusätzlich traps empfehlen

    exit_error()
    {
        if [ $ERROR -eq 1 ]
        then
            die "An error occurred while processing quickinstall mode. Pleasy try manually installation"
        fi
    }
    trap exit_error EXIT SIGINT SIGTERM

siehe Bsp: https://github.com/leonsio/YAHM/blob/master/yahm-init

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants