forked from I2P_Developers/i2p.i2p
Added command scripts for osx to install i2p as a daemon in launchd.
.command extension make it possible to double click on it like bat files in windows. Daemon is runned as the user who executes the command file.
This commit is contained in:
20
installer/resources/install_i2p_service_osx.command
Normal file
20
installer/resources/install_i2p_service_osx.command
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# 2012, The I2P Project
|
||||
# http://www.i2p2.de/
|
||||
# This code is public domain.
|
||||
# Author: Meeh
|
||||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
shfile="tmp$$.sh"
|
||||
echo -n 'cat `pwd`/net.i2p.router.plist |' > `pwd`/$shfile
|
||||
echo -n "sed 's#USERNAME#`whoami`#' " >> `pwd`/$shfile
|
||||
echo -n '| sed "s#COMMAND#`pwd`/i2prouter#" | sed "s#I2PPATH#`pwd`/#" > /Library/LaunchDaemons/net.i2p.router.plist' >> `pwd`/$shfile
|
||||
chmod +x `pwd`/$shfile
|
||||
echo "Please enter your password for sudo privileges to install I2P as a launchd service"
|
||||
sudo ./$shfile
|
||||
sudo launchctl load -F /Library/LaunchDaemons/net.i2p.router.plist
|
||||
if [ $? == 0 ]; then
|
||||
echo "I2P Router wrapper was successfully installed as a launchd service."
|
||||
else
|
||||
echo "I2P Router wrapper was not installed as a launchd service."
|
||||
fi
|
||||
rm -f `pwd`/$shfile
|
Reference in New Issue
Block a user