Skip to content

Instantly share code, notes, and snippets.

@metalefty
Last active August 6, 2016 16:05
Show Gist options
  • Save metalefty/36b99e6062051de3ab90c1a267779789 to your computer and use it in GitHub Desktop.
Save metalefty/36b99e6062051de3ab90c1a267779789 to your computer and use it in GitHub Desktop.
稼働中のシステムがsystemdかどうかを判定する
# check if the system is using systemd or not
[ "$(pgrep -o systemd)" = "1" ] && \
USING_SYSTEMD=false || \
USING_SYSTEMD=true
if $USING_SYSTEMD
then
# systemd だったときに実行するコマンド
else
# systemd じゃなかったときに実行するコマンド
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment