X-Git-Url: https://git.saurik.com/winterboard.git/blobdiff_plain/62b2dbad6360951766f085f50ce8d19c80756395..refs/heads/master:/preinst diff --git a/preinst b/preinst index 357b50c..e5691e6 100755 --- a/preinst +++ b/preinst @@ -1,7 +1,42 @@ #!/bin/bash +declare -a cydia +cydia=($CYDIA) + if [[ $1 == install ]]; then /usr/libexec/cydia/move.sh /Library/Themes + + if [[ ${CYDIA+@} ]]; then + eval "echo 'finish:restart' >&${cydia[0]}" + fi +elif [[ $1 == upgrade ]]; then + if [[ -e /Applications/WinterBoard.app/pledit ]]; then + /Applications/WinterBoard.app/pledit /System/Library/LaunchDaemons/com.apple.SpringBoard.plist \ + -r /Applications/WinterBoard.app/WinterBoard.dylib + if [[ ${CYDIA+@} ]]; then + eval "echo 'finish:reload' >&${cydia[0]}" + fi + else + if [[ ${CYDIA+@} ]]; then + eval "echo 'finish:restart' >&${cydia[0]}" + fi + fi +fi + +if [[ $1 == install || $1 == upgrade ]]; then + chmod 755 /Library/Themes/ + + { + grep -v ' com\.saurik\.winterboard\.' /etc/notify.conf + cat </etc/notify.conf_ && + chmod --reference=/etc/notify.conf /etc/notify.conf_ && + chown --reference=/etc/notify.conf /etc/notify.conf_ && + mv -f /etc/notify.conf{_,} || rm -f /etc/notify.conf_ fi exit 0