diff options
| author | login000 <34250284+login000@users.noreply.github.com> | 2019-09-30 18:58:30 +1000 |
|---|---|---|
| committer | login000 <34250284+login000@users.noreply.github.com> | 2019-09-30 18:58:30 +1000 |
| commit | 921a198601e8e667d98dee0ae0ba8cc88e0a6ac7 (patch) | |
| tree | f1a0f12f099c39c4d556611ad90d0e37a5848424 | |
| parent | eaad7d3d41b616b0800b17c85e5a490e1fe1980c (diff) | |
| download | tcoin-921a198601e8e667d98dee0ae0ba8cc88e0a6ac7.tar.gz | |
npcoin modified to use current directory
npcoin gets new pcoin accounts ready. The relevant paths were hardcoded earlier, but now assume the "tcoin" directory is in the current directory.
| -rw-r--r-- | npcoin | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -3,51 +3,51 @@ if [ "$#" -eq 0 ] || [ "${@^}" = "--help" ] || [ "${@^}" = "-h" ] then /bin/echo "Usage:" - /bin/echo " npcoin <Nameofprogram> : to create pcoin directories for <Nameofprogram>" + /bin/echo " npcoin <Nameofprogram> : to create pcoin directories for <Nameofprogram> (this should be run in the \"tcoin\" folder's containing directory)" /bin/echo " npcoin [ --help | -h ] : to print this help" else - if [ -e "/home/login/tcoin/${@^}.txt" ] + if [ -e "./tcoin/${@^}.txt" ] then - /bin/echo "Sorry, '/home/login/tcoin/${@^}.txt' already exists." + /bin/echo "Sorry, './tcoin/${@^}.txt' already exists." exit 1 else - /bin/echo "0" > "/home/login/tcoin/${@^}.txt" - /bin/chmod 600 "/home/login/tcoin/${@^}.txt" + /bin/echo "0" > "./tcoin/${@^}.txt" + /bin/chmod 600 "./tcoin/${@^}.txt" fi - if [ -e "/home/login/tcoin/messages/${@^}_messages.txt" ] + if [ -e "./tcoin/messages/${@^}_messages.txt" ] then - /bin/echo "Sorry, '/home/login/tcoin/messages/${@^}_messages.txt' already exists." + /bin/echo "Sorry, './tcoin/messages/${@^}_messages.txt' already exists." exit 1 else - /usr/bin/touch "/home/login/tcoin/messages/${@^}_messages.txt" - /bin/chmod 600 "/home/login/tcoin/messages/${@^}_messages.txt" + /usr/bin/touch "./tcoin/messages/${@^}_messages.txt" + /bin/chmod 600 "./tcoin/messages/${@^}_messages.txt" fi - if [ -e "/home/login/tcoin/program_accounting/${@^}" ] + if [ -e "./tcoin/program_accounting/${@^}" ] then - /bin/echo "Sorry, '/home/login/tcoin/program_accounting/${@^}' aleady exists." + /bin/echo "Sorry, './tcoin/program_accounting/${@^}' aleady exists." exit 1 else - /bin/mkdir "/home/login/tcoin/program_accounting/${@^}" - /bin/chmod 700 "/home/login/tcoin/program_accounting/${@^}" + /bin/mkdir "./tcoin/program_accounting/${@^}" + /bin/chmod 700 "./tcoin/program_accounting/${@^}" fi - if [ -e "/home/login/tcoin/program_accounting/${@^}/_TOTAL.txt" ] + if [ -e "./tcoin/program_accounting/${@^}/_TOTAL.txt" ] then - /bin/echo "Sorry, '/home/login/tcoin/program_accounting/${@^}/_TOTAL.txt' already exists." + /bin/echo "Sorry, './tcoin/program_accounting/${@^}/_TOTAL.txt' already exists." exit 1 else - /bin/echo "0" > "/home/login/tcoin/program_accounting/${@^}/_TOTAL.txt" - /bin/chmod 600 "/home/login/tcoin/program_accounting/${@^}/_TOTAL.txt" + /bin/echo "0" > "./tcoin/program_accounting/${@^}/_TOTAL.txt" + /bin/chmod 600 "./tcoin/program_accounting/${@^}/_TOTAL.txt" fi - if [ -e "/home/login/tcoin/program_accounting/${@^}/_MESSAGES.txt" ] + if [ -e "./tcoin/program_accounting/${@^}/_MESSAGES.txt" ] then - /bin/echo "Sorry, '/home/login/tcoin/program_accounting/${@^}/_MESSAGES.txt' already exists." + /bin/echo "Sorry, './tcoin/program_accounting/${@^}/_MESSAGES.txt' already exists." exit 1 else - /bin/echo "0" > "/home/login/tcoin/program_accounting/${@^}/_MESSAGES.txt" - /bin/chmod 600 "/home/login/tcoin/program_accounting/${@^}/_MESSAGES.txt" + /bin/echo "0" > "./tcoin/program_accounting/${@^}/_MESSAGES.txt" + /bin/chmod 600 "./tcoin/program_accounting/${@^}/_MESSAGES.txt" fi fi |