aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlogin (tilde.club) <login@tilde.club>2019-11-15 19:21:57 -0700
committerlogin (tilde.club) <login@tilde.club>2019-11-15 19:21:57 -0700
commit3dfe89db4a2e19341d178197d5f805972c4d4e68 (patch)
tree7954af660a9b93da784b43326d656692aa62c84d
parent8573e74a01824341c54d0fdd7e5c1e70a0a7a323 (diff)
downloadtcoin-3dfe89db4a2e19341d178197d5f805972c4d4e68.tar.gz
Added check for number of basecoins <n> in ntcoin
ntcoin would accept no number of basecoins <n>. Now, there is a check added near the beginning for <n> existing and being a non-negative integer.
-rwxr-xr-xntcoin5
1 files changed, 5 insertions, 0 deletions
diff --git a/ntcoin b/ntcoin
index c8ab122..407a75f 100755
--- a/ntcoin
+++ b/ntcoin
@@ -28,6 +28,11 @@ then
#define DA_OFF
#define MINERCOIN_OFF'
else
+ #see https://stackoverflow.com/a/3951175
+ case $3 in
+ ''|*[!0-9]*) /bin/echo "Sorry, the number of basecoins <n> should be a positive integer."; exit 1 ;;
+ *) ;;
+ esac
if [ -d "`/usr/bin/realpath -s $1`/tcoin" ]
then
/bin/echo "Sorry, '`/usr/bin/realpath -s $1`/tcoin' already exists."