forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File struct scripts fix (hyperledger#430)
* Fix read_ledger, gen_indy_pool; add create_dirs Signed-off-by: Dmitry Surnin <[email protected]> * Remove dirs create form setup.py Signed-off-by: Dmitry Surnin <[email protected]> * Fix dir name in home folder Signed-off-by: Dmitry Surnin <[email protected]>
- Loading branch information
1 parent
6c92abb
commit a863af8
Showing
4 changed files
with
53 additions
and
56 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "${SUDO_USER}" == "" ]; then | ||
echo "It should be run with sudo" | ||
exit | ||
fi | ||
|
||
# dirs to be created | ||
node_dirs="/etc/indy /var/lib/indy /var/log/indy /home/${SUDO_USER}/.indy-cli" | ||
|
||
# create dirs | ||
for dr in $node_dirs | ||
do | ||
mkdir -p $dr | ||
done | ||
|
||
# generate base config if not exists | ||
if [ ! -f /etc/indy/indy_config.py ]; then | ||
echo "NETWORK_NAME = 'sandbox'" > /etc/indy/indy_config.py | ||
|
||
echo "baseDir = '/var/lib/indy'" >> /etc/indy/indy_config.py | ||
echo "NODE_BASE_DATA_DIR = baseDir" >> /etc/indy/indy_config.py | ||
echo "CLI_BASE_DIR = '~/.indy-cli/'" >> /etc/indy/indy_config.py | ||
echo "CLI_NETWORK_DIR = '~/.indy-cli/networks'" >> /etc/indy/indy_config.py | ||
echo "LOG_DIR = '/var/log/indy'" >> /etc/indy/indy_config.py | ||
fi | ||
|
||
# grant permissions | ||
for dr in $node_dirs | ||
do | ||
chown -R ${SUDO_USER}:${SUDO_USER} $dr | ||
chmod -R ug+rwx $dr | ||
done |
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
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