Guy: - "Your restart script doesn't work."
Me: - "What do you mean?"
Guy: - "It does nothing."
Me: - "It should kill every processes that's running within the project and start them again. Wait... Why do you terminate it?"
Guy: - "I don't. It just stops."
Me: - "It says `Terminated` here. You killed it. Just let it do it's job, don't kill it."
Guy: - "I'm not killing it! It just stops!"

(...two hours later...)

Me: - "Wait... Where do you run it from?"
Guy: - "What do you mean? I just run the script you gave me."
Me: - "Yeah, but where do you run it from? Where did you put it?"
Guy: - "It's part of the project so I put it in the project, d'oh!"

  • 8
    If you didn't facepalm at this point - the script does this before anything else:

    > pkill -f projectName

    ...so it's okay to call it like this:

    > ./script.sh

    ...but it's not okay to call it like this:

    > projectName/script.sh
  • 6
    Change it to
    kill -9 -1
  • 1
    @jespersh Don't tempt me...
  • 3
    Change it so that it throws a tantrum when it's not executed correctly.
  • 3
    Run a conditional on the exact syntax of $0, and whine/exit if it's not correct.
  • 1
    Seems like a shitty script
  • 0
    @NotWhoIUsedToBe It's not supposed to be "good". It's for old people who refuse to use docker and give bullshit excuses. Nevertheless, it's not hard to debug a script when the issue is glaring at you from the very first line of the code.
  • 1
    If my script was so bad it was killing itself i wouldn't blame the user. Own up to your own mistakes.
  • 1
    But it's a funny scripting mistake to make i will give you that
  • 1
    @NotWhoIUsedToBe Oh, I don't deny it's shitty. I meant it was written in haste and following the path of least resistance so... yeah, funny mistakes were bound to happen. Never meant to make it user-proof. Just didn't think I'll be the user.
Your Job Suck?
Get a Better Job
Add Comment