ok, i have tried it the new way, here is the code for both root and user password based on the last post you made :
- 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
}
if [[ $install = "expert" ]]; then
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
}
here is the error log :
Current default time zone: 'Africa/Johannesburg'
Local time is now: Mon Jan 20 16:10:06 SAST 2014.
Universal Time is now: Mon Jan 20 14:10:06 UTC 2014.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
mke2fs 1.42.8 (20-Jun-2013)
Generating grub.cfg ...
using custom appearance settings
Found background image: /usr/share/Boot.png
Found linux image: /boot/vmlinuz-3.12-1-686-pae
Found initrd image: /boot/initrd.img-3.12-1-686-pae
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
done
sed: couldn't edit /target/home/test/.config/flareGet: not a regular file
sed: can't read Settings/flareGet.conf: No such file or directory
sed: can't read Binary: No such file or directory
sed: can't read file: No such file or directory
sed: can't read matches: No such file or directory
/usr/bin/refractainstaller-yad: line 1482: syntax error: unexpected end of file
It does exactly the same as before, its gets to where it asks new user name, then new real user name, then just exits without warning. it does not pop up any of the root or user password related boxes at all.
Line1482 is the last line in the yad file, after error log and everything else.
- 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
}
if [[ $install = "expert" ]]; then
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
}
if [[ $change_user = "yes" ]]; then
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
rm -f /target/home/*/Desktop/refractainstaller.desktop
rm -f /target/home/*/Desktop/Install-Guide.desktop
# copy error log to installation before calling cleanup function
cp "$error_log" /target/var/log/
cleanup
yad --image=gtk-dialog-info --title="$version" --text=" MakuluLinux Installation complete! \n\n You may now reboot into the new system.\n\n Remember to remove your installation media.\n" --width=500 --button="OK":0
exit 0
<------- This is line 1482
Think it might be easier if i send you my Yad file, then you can see for yourself what i have done. check your inbox.