printerror "Please run this script as your normal user, we will prompt you for your sudo password when needed. Or you can use the --plaintext option"
exit 1
fi
-fi
-
-echo "Please provide sudo password, as some parts of this script requires it"
-if ! sudo true; then
- printerror "Sorry, this script requires working sudo privileges to function"
- exit 1
+else
+ echo "Please provide sudo password, as some parts of this script requires it"
+ if ! sudo true; then
+ printerror "Sorry, this script requires working sudo privileges to function"
+ exit 1
+ fi
fi
# Test for supported OS
# The Linux way
if [ "${Uname}" = "linux" ]; then
if [ "${Plaintext}" = "YES" ]; then
- PrinterShare="smb://${Username}:${Password}@${Workgroup}/${PrintServer}/${PrintFile}"
+ PrinterShare="smb://${Workgroup}/${Username}:${Password}@${PrintServer}/${PrintFile}"
AuthInfo="none"
echo -e "\nNOTE: Your credentials will be stored in plaintext in /etc/cups/printers.conf.\nThis is usually only necessary on headless systems or on systems that don't run a dbus-daemon and/or a keyring that can provide the org.freedesktop.secrets service.\nNeedless to say, this is not a good idea on multi-user systems.\n"
else