mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-05-25 22:14:38 +00:00
Add installation checks to launchd.sh for improved user feedback
This commit is contained in:
parent
18c422101b
commit
a0615229ef
@ -8,6 +8,16 @@ LOCATION=~/Library/Application\ Support/rpc-bridge
|
|||||||
SCRIPT=$LOCATION/rpc-bridge
|
SCRIPT=$LOCATION/rpc-bridge
|
||||||
AGENT=~/Library/LaunchAgents/com.enderice2.rpc-bridge.plist
|
AGENT=~/Library/LaunchAgents/com.enderice2.rpc-bridge.plist
|
||||||
|
|
||||||
|
function is_installed() {
|
||||||
|
if [ -f "$AGENT" ]; then
|
||||||
|
launchctl list | grep -q "com.enderice2.rpc-bridge"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
# Directories
|
# Directories
|
||||||
if [ ! -d "$SYMLINK" ]; then
|
if [ ! -d "$SYMLINK" ]; then
|
||||||
@ -71,9 +81,16 @@ fi
|
|||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
install)
|
install)
|
||||||
|
if is_installed; then
|
||||||
|
echo "LaunchAgent is already installed."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
install
|
install
|
||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
|
if ! is_installed; then
|
||||||
|
echo "LaunchAgent is not installed. Continuing anyway."
|
||||||
|
fi
|
||||||
remove
|
remove
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user