Skip to content

Instantly share code, notes, and snippets.

@Galarius
Galarius / self-detach.sh
Created October 22, 2016 07:41
Self-detaching shell script
#!/bin/bash
# self-detach.sh
# Self-detaching shell script
#------------------------------------------
if [ -z "$_DETACHED_" ]
then
# Run this script silently in background
# mode with low priority
_DETACHED_=1 nohup nice sh $0 &>/dev/null