#!/bin/bash INSTALLDIR=`pwd` TARGETDIR=/usr/bin/tyan/tlcd version1=`cat /proc/version | grep -i "Red"` if [[ $version1 != "" ]]; then redhat=1 else redhat=0 fi version2=`cat /proc/version | grep -i "SuSE"` if [[ $version2 != "" ]]; then suse=1 else suse=0 fi mkdir -p $TARGETDIR install -m755 twin $TARGETDIR/tlcd install -m755 tysmdll.so $TARGETDIR/tysmdll.so install -m444 mbconf $TARGETDIR/mbconf #RedHat if [[ $redhat = 1 ]]; then cat > /etc/init.d/tlcd << HeadEnd #!/bin/bash # Tyan LCD Daemon # source function library . /etc/init.d/functions HeadEnd cat >> /etc/init.d/tlcd << DefEnd tlcdname=tlcd TARGETDIR=/usr/bin/tyan/tlcd DefEnd cat >> /etc/init.d/tlcd << 'End' RETVAL=0 start() { echo -n $"Starting $tlcdname: " $TARGETDIR/$tlcdname RETVAL=$? echo return $RETVAL } stop() { echo -n $"Stopping $tlcdname: " killproc $tlcdname RETVAL=$? echo return $RETVAL } restart(){ stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status $tlcdname RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|status|restart}" RETVAL=1 esac exit $RETVAL End #Dec 1, 2006 version3=`cat /etc/redhat-release | grep -i "4"` if [[ $version3 != "" ]]; then install -m444 tlcd.conf.rhel4 /etc/tlcd.conf else install -m444 tlcd.conf.rh9 /etc/tlcd.conf fi fi #SuSE if [[ $suse = 1 ]]; then cat > /etc/init.d/tlcd << HeadEnd #!/bin/bash # Tyan LCD Daemon # source function library . /etc/rc.status rc_reset HeadEnd cat >> /etc/init.d/tlcd << DefEnd tlcdname=tlcd TARGETDIR=/usr/bin/tyan/tlcd DefEnd cat >> /etc/init.d/tlcd << 'End' RETVAL=0 start() { echo -n $"Starting $tlcdname: " $TARGETDIR/$tlcdname rc_status -v rc_reset } stop() { echo -n $"Stopping $tlcdname: " killproc $tlcdname rc_status -v rc_reset } restart(){ stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) echo -n "$tlcdname: " checkproc $tlcdname rc_status -v rc_reset ;; *) echo $"Usage: $0 {start|stop|status|restart}" RETVAL=1 esac exit $RETVAL End install -m444 tlcd.conf.suse91pro /etc/tlcd.conf fi cp /etc/tlcd.conf /etc/tlcd.conf.sample ./tlcdinst [ $? -eq 0 ] && \ chmod a+x /etc/init.d/tlcd && \ ( echo "Installation complete"; /etc/init.d/tlcd start ) || \ ( echo "Installation failed"; exit 1) ln -sf /etc/init.d/tlcd /etc/rc.d/rc3.d/S99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc5.d/S99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc0.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc1.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc2.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc3.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc4.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc5.d/K99tlcd && \ ln -sf /etc/init.d/tlcd /etc/rc.d/rc6.d/K99tlcd [ $? -eq 0 ] && echo "Symbolic links created" || echo "Cannot create symbolic links"