You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-01-03 17:02:30 +03:00
postfixadmin-cli: use readlink if $0 is a symlink
- use readlink if $0 is a symlink (for example in /usr/bin) so that postfixadmin-cli.php can be found Reported by john doe (johndoe64@SF), https://sourceforge.net/tracker/?func=detail&aid=3232183&group_id=191583&atid=937964 - add quoting to all variables git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1023 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -23,8 +23,14 @@
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIB=${0/%postfixadmin-cli/}
|
||||
# LIB is expected to be relative to this script (inside the PostfixAdmin sources)
|
||||
# This breaks if you symlink postfixadmin-cli to /usr/bin or alike. Therefore we
|
||||
# have to follow the symlink to get the correct path.
|
||||
self="$0"
|
||||
test -L "$self" && self="`readlink -f \"$self\"`"
|
||||
|
||||
exec php -q ${LIB}postfixadmin-cli.php "$@"
|
||||
LIB="${self/%postfixadmin-cli/}"
|
||||
|
||||
exec php -q "${LIB}postfixadmin-cli.php" "$@"
|
||||
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user