HP PCRF Oracle TVOE - User password change template

Vendor: HP
Product: PCRF Oracle - TVOE
Executor: SSH

set-connect-timeout 10
set-read-timeout 10
set-ssh-version 2

# Definir linguagem como inglês
expect-regex "/[#$>]/"
exec "export LC_ALL=C"

# Executa passwd
expect-regex "/[#$>]/"
exec "sudo passwd [#USERNAME#]"

# Nova senha
expect "*password:"
exec "[#NEW_PASSWORD#]"

# Confirmação senha
expect "*password:"
exec "[#NEW_PASSWORD#]"

# Valida resultado
expect "*updated successfully"

expect-regex "/[#$>]/"
exec "sudo chage -d 1 [#USERNAME#]"

# Sai e termina script
expect-regex "/[#$>]/"
exec "exit"
end