strip the dash
This commit is contained in:
parent
e12cc2fbbf
commit
fcad068016
2 changed files with 11 additions and 7 deletions
|
@ -160,20 +160,24 @@ def write_pid(pid_file):
|
|||
print('Fatal Error: Unable to write pid file {}'.format(pid_file))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def install_osx():
|
||||
app_path = os.popen('pwd').read().strip()
|
||||
hass_path = os.popen('which hass').read().strip()
|
||||
user = os.popen('whoami').read().strip()
|
||||
|
||||
plist = codecs.open('scripts/org.home-assistant.plist', 'r', 'utf-8')
|
||||
plist = codecs.open('scripts/org.homeassistant.plist', 'r', 'utf-8')
|
||||
plist = plist.read()
|
||||
|
||||
plist = plist.replace("$APP_PATH$", app_path)
|
||||
plist = plist.replace("$HASS_PATH$", hass_path)
|
||||
plist = plist.replace("$USER$", user)
|
||||
|
||||
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
||||
os.remove(path)
|
||||
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
||||
|
||||
if os.path.isfile(path):
|
||||
os.remove(path)
|
||||
|
||||
plist_file = codecs.open(path, 'w', 'utf-8')
|
||||
plist_file.write(plist)
|
||||
plist_file.close()
|
||||
|
@ -184,7 +188,7 @@ def install_osx():
|
|||
|
||||
|
||||
def uninstall_osx():
|
||||
path = os.path.expanduser("~/Library/LaunchAgents/org.home-assistant.plist")
|
||||
path = os.path.expanduser("~/Library/LaunchAgents/org.homeassistant.plist")
|
||||
os.popen('launchctl unload ' + path)
|
||||
|
||||
print("Home Assistant has been uninstalled.")
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.home-assitant</string>
|
||||
<string>org.homeassitant</string>
|
||||
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
|
@ -30,10 +30,10 @@
|
|||
<string>$APP_PATH$</string>
|
||||
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/Users/$USER$/Library/Logs/home-assitant.log</string>
|
||||
<string>/Users/$USER$/Library/Logs/homeassitant.log</string>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>/Users/$USER$/Library/Logs/home-assitant.log</string>
|
||||
<string>/Users/$USER$/Library/Logs/homeassitant.log</string>
|
||||
|
||||
</dict>
|
||||
</plist>
|
Loading…
Add table
Reference in a new issue