diff --git a/debian/postinst b/debian/postinst index c565c24c300d82c9d4e40ce09dc771befcfb2df6..bd2d28bbb266cdb7a8b69c2cc3279a7fa72bf86c 100755 --- a/debian/postinst +++ b/debian/postinst @@ -39,12 +39,21 @@ else systemctl --system enable $DAP_PREFIX/share/$DAP_APP_NAME.service # systemctl --system start $DAP_APP_NAME fi - USERMAN=`users | awk '{print $1}'` - #groupadd $DAP_CHAINS_NAME + #USERMAN=`users | awk '{print $1}'` + groupadd $DAP_CHAINS_NAME #usermod -aG $DAP_CHAINS_NAME `users | awk '{print $1}'` + for username in $(cat /etc/passwd | grep "/home" | cut -d ':' -f1); do + usermod -aG $DAP_CHAINS_NAME $username + done mkdir -p $DAP_PREFIX/var/{run,lib/ca,lib/wallet,lib/global_db} touch $DAP_PREFIX/var/run/kelvin-node.pid - chown -R $USERMAN:$USERMAN $DAP_PREFIX - chmod 0775 $DAP_PREFIX/var/{run,lib/ca,lib/wallet,lib/global_db} + #chown -R $USERMAN:$USERMAN $DAP_PREFIX + for filename in $(find $DAP_PREFIX); do + if [ -d $filename ]; then + chmod 0775 $filename + else + chmod 0664 $filename + fi + done echo "For start $DAP_APP_NAME - run 'systemctl start $DAP_APP_NAME'"