mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-23 22:09:53 +07:00
arc-functions: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
3e010b781a
commit
3ccb91be9f
@ -1493,11 +1493,8 @@ function resetPassword() {
|
||||
for I in ${DSMROOTS}; do
|
||||
mount -t ext4 "${I}" "${TMP_PATH}/mdX"
|
||||
[ $? -ne 0 ] && continue
|
||||
OLDPASSWD="$(cat "${TMP_PATH}/mdX/etc/shadow" 2>/dev/null | grep "^${USER}:" | awk -F ':' '{print $2}')"
|
||||
if [ -n "${NEWPASSWD}" -a -n "${OLDPASSWD}" ]; then
|
||||
sed -i "s|${OLDPASSWD}|${NEWPASSWD}|g" "${TMP_PATH}/mdX/etc/shadow"
|
||||
sed -i "/^${USER}:/ s/\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\)/\1:\2:\3:\4:\5:\6:\7::\9/" "${TMP_PATH}/mdX/etc/shadow"
|
||||
fi
|
||||
sed -i "s|^${USER}:[^:]*|${USER}:${NEWPASSWD}|" "${TMP_PATH}/mdX/etc/shadow"
|
||||
sed -i "/^${USER}:/ s/^\(${USER}:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\)[^:]*:/\1:/" "${TMP_PATH}/mdX/etc/shadow"
|
||||
sed -i "s|status=on|status=off|g" "${TMP_PATH}/mdX/usr/syno/etc/packages/SecureSignIn/preference/${USER}/method.config" 2>/dev/null
|
||||
sync
|
||||
umount "${TMP_PATH}/mdX"
|
||||
|
Loading…
Reference in New Issue
Block a user