Skip to content

Commit

Permalink
Merge pull request #436 from herrwagner/master
Browse files Browse the repository at this point in the history
Set 'setKey' and 'webpwd' in debian postinst script only on new installations.
  • Loading branch information
neilcook authored Feb 6, 2025
2 parents e3934ce + b08a6ad commit 87675e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions builder-support/debian/wforce-trackalert.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ case "$1" in
adduser --quiet --system --home /var/spool/wforce --shell /bin/false --ingroup wforce --disabled-password --disabled-login --gecos "wforce" wforce
echo "done"
fi
echo -n "Modifying trackalert.conf to replace password and key..."
SETKEY=`echo "makeKey()" | trackalert | grep setKey`
WEBPWD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 | rev | cut -b 2-14 | rev`
sed -e "s#--WEBPWD#$WEBPWD#" -e "s#--SETKEY#$SETKEY#" -i $TRACKALERTCONF
echo "done"
if [ -z "$2" ]; then
echo -n "Modifying trackalert.conf to replace password and key..."
SETKEY=`echo "makeKey()" | trackalert | grep setKey`
WEBPWD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 | rev | cut -b 2-14 | rev`
sed -e "s#--WEBPWD#$WEBPWD#" -e "s#--SETKEY#$SETKEY#" -i $TRACKALERTCONF
echo "done"
fi
;;

*)
Expand Down
12 changes: 7 additions & 5 deletions builder-support/debian/wforce.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ case "$1" in
mv /etc/wforce.conf /etc/wforce/wforce.conf && \
echo "Moved /etc/wforce.conf to /etc/wforce/wforce.conf"
fi
echo -n "Modifying wforce.conf to replace password and key..."
SETKEY=`echo "makeKey()" | wforce | grep setKey`
WEBPWD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 | rev | cut -b 2-14 | rev`
sed -e "s#--WEBPWD#$WEBPWD#" -e "s#--SETKEY#$SETKEY#" -i $WFORCECONF
echo "done"
if [ -z "$2" ]; then
echo -n "Modifying wforce.conf to replace password and key..."
SETKEY=`echo "makeKey()" | wforce | grep setKey`
WEBPWD=`dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 | rev | cut -b 2-14 | rev`
sed -e "s#--WEBPWD#$WEBPWD#" -e "s#--SETKEY#$SETKEY#" -i $WFORCECONF
echo "done"
fi
;;

*)
Expand Down

0 comments on commit 87675e4

Please sign in to comment.