Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 37 lines (33 sloc) 1.331 kb
209f15b Alvaro Lopez Ortega cherokee-admin-launcher now tries to run cherokee-admin as root. For
alobbs authored
1 #! /bin/sh
2 #
3 # Copyright (C) 2001-2010 Alvaro Lopez Ortega
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of version 2 of the GNU General Public
7 # License as published by the Free Software Foundation.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17 # USA
18
19 TITLE="Root password required"
20 EXPLANATION="Please, provide the root password. Cherokee-admin requires system privileges."
21
22 DIALOG="display dialog \"$EXPLANATION\""
23 DIALOG="$DIALOG default answer \"\" "
a2b10e5 Alvaro Lopez Ortega Fixes an issue on our MacOS X's askpass script. Thanks to Pablo de la
alobbs authored
24 DIALOG="$DIALOG buttons {\"Cancel\", \"OK\"} "
209f15b Alvaro Lopez Ortega cherokee-admin-launcher now tries to run cherokee-admin as root. For
alobbs authored
25 DIALOG="$DIALOG default button \"OK\" "
26 DIALOG="$DIALOG with title \"$TITLE\" "
27 DIALOG="$DIALOG with icon note "
28 DIALOG="$DIALOG with hidden answer"
29
30 result=`osascript -e 'tell application "Finder"' -e "activate" -e "$DIALOG" -e 'end tell'`
31 if [ "$result" = "" ]; then
32 exit 1
33 else
34 echo "$result" | sed -e 's/^text returned://' -e 's/, button returned:.*$//'
35 exit 0
36 fi
Something went wrong with that request. Please try again.