# refracta.freeforums.org

place to talk about refracta

Skip to content

Welcome
Welcome to refracta You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

## Refracta Installer on Debian Distro - Makululinux

Refracta Development, Scripts, etc.
Post a reply
92 posts • Page 10 of 10 • 1 ... 6, 7, 8, 9, 10

### Re: Refracta Installer on Debian Distro - Makululinux

by fsmithred » Tue Jan 21, 2014 10:32 am

Run it in debug mode for more information.

fsmithred
  Posts: 2101
  Joined: Wed Mar 09, 2011 9:13 pm

Top

### Re: Refracta Installer on Debian Distro - Makululinux

by raymerjacque » Thu Mar 27, 2014 6:11 pm

I managed to fix the password loop issue with the following code :

Code: Select all
  `# Change/create root password
  change_root_pass () {
  newpass=$(yad --form --field "Password:H" --field "Retype Password:H" --separator="@_@" --title "Password" --image="dialog-password" --button=OK:0 --button=Cancel:1)
  if [[ $? = 1 ]] ; then
  return
  fi
  if [ $(echo $newpass | awk -F"@_@" '{print $1}') != $(echo $newpass | awk -F"@_@" '{print $2}') ] ; then
  try_again_1
  return
  else
  # Redirect stderr to keep the output of the passwd command.
  exec 2>&1
  echo $newpass | sed 's/@_@/\n/g' | chroot /target passwd
  # Resume logging errors in file
  exec 2>>"$error_log"
  fi
  }
  try_again_1 () {
  yad --image="gtk-dialog-warning" --title "Error" --button=Yes:0 --button=No:1 \
  --text "Entries do not match. Do you want to try again?\n(If you say No, password will not be changed.)"
  if [[ $? = 0 ]] ; then
  change_root_pass
  fi
  }
  yad --title="Change Root password" --button=Yes:0 --button=No:1 \
  --text="Would you like to change the Root password?
  This is highly Recommended. "
  if [[ $? = 0 ]]; then
  change_root_pass
  fi
  # Change user password
  change_user_pass () {
  newpass=$(yad --form --field "Password:H" --field "Retype Password:H" --separator="@_@" --title "Password" --image="dialog-password" --button=OK:0 --button=Cancel:1)
  if [[ $? = 1 ]] ; then
  return
  fi
  if [ $(echo $newpass | awk -F"@_@" '{print $1}') != $(echo $newpass | awk -F"@_@" '{print $2}') ] ; then
  try_again_1
  return
  else
  # Redirect stderr to keep the output of the passwd command.
  exec 2>&1
  echo $newpass | sed 's/@_@/\n/g' | chroot /target passwd "$newname"
  # Resume logging errors in file
  exec 2>>"$error_log"
  fi
  }
  try_again_1 () {
  yad --image="gtk-dialog-warning" --title "Error" --button=Yes:0 --button=No:1 \
  --text "Entries do not match. Do you want to try again?\n(If you say No, password will not be changed.)"
  if [[ $? = 0 ]] ; then
  change_user_pass
  fi
  }
  yad --title="Change user password" --button=Yes:0 --button=No:1 \
  --text="Would you like to change the user's password?
  This is highly Recommended. "
  if [[ $? = 0 ]]; then
  change_user_pass
  fi
  `

Tested and works
and this way the user is not asked if he or she wants to change passwords dependent on install mode, it simply forces the question, which is what i needed on my distro.
Thank you for all your help, Great installer you have made

raymerjacque
  Posts: 111
  Joined: Sun Nov 03, 2013 9:37 am

Top

Previous Display posts from previous:
Sort by

Post a reply
92 posts • Page 10 of 10 • 1 ... 6, 7, 8, 9, 10

Return to Discuss

Jump to:

### Who is online

Users browsing this forum: No registered users and 0 guests

Donate Now
ProNight Style by ModphpBB3
Hosted by © 2017 FreeForums.org | Create a free forum | Powered by phpBB
A Member of the Crowdgather Forum Community
About FreeForums | Legal | Advertise Here | Investors | Contact FreeForums.org
Report Violation
suspicion-preferred