Skip to content

Commit a3ee49e

Browse files
committed
give the option
1 parent ac9080f commit a3ee49e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

autopkg-setup.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ installAutoPkg() {
114114
echo "ALERT: REQUIRES ADMIN RIGHTS - please enter account password"
115115
echo
116116
echo "### Prompting for administrator credentials to install AutoPkg..."
117-
/usr/bin/osascript -e 'do shell script "installer -pkg /tmp/autopkg-latest.pkg -target /" with administrator privileges'
117+
if [[ $native_prompt == "yes" ]]; then
118+
# Use native prompt if requested
119+
/usr/bin/osascript -e 'do shell script "installer -pkg /tmp/autopkg-latest.pkg -target /" with administrator privileges'
120+
else
121+
# Use sudo prompt
122+
echo "Please enter your administrator password to install AutoPkg."
123+
sudo installer -pkg /tmp/autopkg-latest.pkg -target /
124+
fi
118125

119126
autopkg_version=$(${AUTOPKG} version)
120127

@@ -254,6 +261,8 @@ do
254261
case "$1" in
255262
-f|--force) force_autopkg_update="yes"
256263
;;
264+
--prompt) native_prompt="yes"
265+
;;
257266
-b|--beta)
258267
force_autopkg_update="yes"
259268
use_beta="yes"

0 commit comments

Comments
 (0)