Skip to content

Commit

Permalink
add adminpaswd.d hook directory support
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Aug 26, 2017
1 parent b61dc10 commit 2ad4690
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Empty file.
7 changes: 7 additions & 0 deletions board/common/overlay/usr/sbin/adminpasswd
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ echo -en "$PASSWORD\n$PASSWORD\n" | passwd admin &>/dev/null # admin
sed -r -i 's/root:([^:]+):[[:digit:]]+:/root:\1::/' /data/etc/shadow # removes pwd expiration
sed -r -i 's/admin:([^:]+):[[:digit:]]+:/admin:\1::/' /data/etc/shadow # removes pwd expiration

# call admin password hooks in /etc/adminpasswd.d
if [ -d /etc/adminpasswd.d ]; then
for script in /etc/adminpasswd.d/*; do
test -x $script && $script
done
fi

0 comments on commit 2ad4690

Please sign in to comment.