Skip to content

Instantly share code, notes, and snippets.

@yuta0801
Created May 7, 2019 12:14
Show Gist options
  • Save yuta0801/01a3966f447d4456103d0a5657502d41 to your computer and use it in GitHub Desktop.
Save yuta0801/01a3966f447d4456103d0a5657502d41 to your computer and use it in GitHub Desktop.
パイピングサーバーからコマンドを取得して実行するシェルスクリプト
#!/bin/bash -e
if [ $# -ne 1 ]; then
echo "引数(パス)が必要です。" 1>&2
exit 1
fi
CMD=$(curl -m 5 -sS "https://ppng.ml/$1")
read -p "$CMD を実行しますか? (y/N): " YN
case $YN in
"Y" | "y" | "yes" | "Yes" | "YES" );;
* ) exit 0
esac
eval $CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment