#! /bin/bash
LINE=`grep -oP '.*main.*": ".*"' /home/mz/deployment/Frontend/ngsw.json`
IFS=': ' read -r -a array <<< $LINE
FILE="${array[0]//\"/}"
NEWHASH=($(sha1sum /home/mz/deployment/Frontend$FILE))
OLDHASH="${array[1]//\"/}"
sed -i "s/$OLDHASH/$NEWHASH/g" /home/mz/deployment/Frontend/ngsw.json