#!/bin/sh

test -f /etc/init.d/S93gotty && echo "you have already installed gotty" && exit 0
pidof gotty && echo "you have already running gotty" && exit 0

test -d /usr/local/apps/gotty/ || mkdir -p /usr/local/apps/gotty/ && \
wget http://rom.nanodm.net/opt/gotty/gotty.arm -O/usr/local/apps/gotty/gotty && \
chmod a+rx /usr/local/apps/gotty/gotty && \
wget http://rom.nanodm.net/opt/gotty/S93gotty -O/etc/init.d/S93gotty && \
chmod a+rx /etc/init.d/S93gotty && \
/etc/init.d/S93gotty start
