git.slaskete.net
/
einar-bin
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Scan-hjelpeverktøy
[einar-bin]
/
addfollowmeprint.sh
diff --git
a/addfollowmeprint.sh
b/addfollowmeprint.sh
index 226900c0a475f746d1ee6cb12614bd02b70b7ef2..f50b1d0136d28d6fe594aa674033c8f8bdc56b62 100755
(executable)
--- a/
addfollowmeprint.sh
+++ b/
addfollowmeprint.sh
@@
-224,9
+224,9
@@
echo "This script will add a new printer called ${QueueName}, connecting to the
print server ${PrintServer} using your user name and password from NTNU."
# Get username and password
print server ${PrintServer} using your user name and password from NTNU."
# Get username and password
-printf "User name: "
+printf "
NTNU
User name: "
read -r Username
read -r Username
-printf "Password: "
+printf "
NTNU
Password: "
Settings=$(stty -g)
stty -echo
read -r Password
Settings=$(stty -g)
stty -echo
read -r Password
@@
-313,9
+313,6
@@
if [ "${Uname}" = "darwin" ]; then
exit 1
fi
exit 1
fi
- sudo cupsenable "${QueueName}"
- sudo cupsaccept "${QueueName}"
-
# Add credentials to the keychain if they are missing
# Shamelessly stolen^W^WBorrowed from https://github.com/Orakeltjenesten/scripts/blob/33abfb353524f449f0bbdee27adb2f1f0a9756a2/print/ntnuprint-mac.sh
security -v add-internet-password -U -a "${Workgroup}\\${Username}" -s "${PrintServer}" \
# Add credentials to the keychain if they are missing
# Shamelessly stolen^W^WBorrowed from https://github.com/Orakeltjenesten/scripts/blob/33abfb353524f449f0bbdee27adb2f1f0a9756a2/print/ntnuprint-mac.sh
security -v add-internet-password -U -a "${Workgroup}\\${Username}" -s "${PrintServer}" \
@@
-326,8
+323,14
@@
if [ "${Uname}" = "darwin" ]; then
# Make sure the password has the correct ACL ref https://mostlikelee.com/blog-1/2017/9/16/scripting-the-macos-keychain-partition-ids
OS_Min_Vers=$(sw_vers | grep ProductVersion | awk '{print $2}' | cut -d "." -f2)
if [ "${OS_Min_Vers}" -ge 12 ]; then
# Make sure the password has the correct ACL ref https://mostlikelee.com/blog-1/2017/9/16/scripting-the-macos-keychain-partition-ids
OS_Min_Vers=$(sw_vers | grep ProductVersion | awk '{print $2}' | cut -d "." -f2)
if [ "${OS_Min_Vers}" -ge 12 ]; then
- security set-generic-password-partition-list -S "apple-tool:,apple:" -s "${PrintServer}" -k "${Password}"
+ echo -e "\nNOTE: You need to provide your local Mac password again here in order to give the printing system access to your credentials.\n"
+ security set-internet-password-partition-list -S "apple-tool:,apple:" -s "${PrintServer}" > /dev/null
fi
fi
+
+ sudo cupsenable "${QueueName}"
+ sudo cupsaccept "${QueueName}"
+ sudo launchctl stop org.cups.cupsd
+ sudo launchctl start org.cups.cupsd
fi
# Set correct paper size and enable the duplexer option
fi
# Set correct paper size and enable the duplexer option