Created
May 7, 2019 12:14
-
-
Save yuta0801/01a3966f447d4456103d0a5657502d41 to your computer and use it in GitHub Desktop.
パイピングサーバーからコマンドを取得して実行するシェルスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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