From: Einar Jørgen Haraldseid Date: Mon, 29 Jul 2019 19:00:19 +0000 (+0200) Subject: Tweak: Better supported syntax for URI on Linux X-Git-Url: https://git.slaskete.net/einar-bin/commitdiff_plain/d0516fbae9de87ae04446ad16fd342c7f0cec28d Tweak: Better supported syntax for URI on Linux --- diff --git a/addfollowmeprint.sh b/addfollowmeprint.sh index 75c7215..035767d 100755 --- a/addfollowmeprint.sh +++ b/addfollowmeprint.sh @@ -83,12 +83,12 @@ if [ ${UID} -eq 0 ]; then 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 @@ -264,7 +264,7 @@ sudo lpadmin -x ${QueueName} > /dev/null 2>&1 # 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