📄 install.sh
字号:
#!/bin/sh#Do not run directly. This is a helper script for make.BINDIR=$1if [ -z "$BINDIR" ]; then BINDIR=/usr/local/binfimakepath(){ p="$1" ( # Absolut Unix. if echo $p | grep '^/' >/dev/null then cd / fi # This will break if $1 contains a space. for c in `echo $p | tr '/' ' '` do if [ -d "$c" ] || mkdir "$c" then cd "$c" || return $? else echo "failed to create $c" >&2; return $? fi done )}copy(){ if [ -f $2 ]; then echo " Skipped $2, file already exists" else echo " $2" cp $1 $2 fi }forcecopy(){ if [ -f $2 ]; then echo " Overwriting $2" cp $1 $2 else echo " $2" cp $1 $2 fi}delete(){ if [ -f $1 ]; then echo " Deleting $1" rm $1 fi}makedir(){ if [ -d $1 ]; then echo " Skipped $1, directory already exists" else echo " Creating directory $1" mkdir $1 fi}echo ""if [ ! -f src/smsd ] && [ ! -f src/smsd.exe ]; then echo 'Please run "make -s install" instead.' exit 1fiecho "Installing binary program files"makepath $BINDIRif [ -f src/smsd.exe ]; then forcecopy src/smsd.exe $BINDIR/smsd.exeelse forcecopy src/smsd $BINDIR/smsdfidelete $BINDIR/getsmsdelete $BINDIR/putsmsecho "Installing some scripts"copy scripts/sendsms $BINDIR/sendsmscopy scripts/sms2html $BINDIR/sms2htmlcopy scripts/sms2unicode $BINDIR/sms2unicodecopy scripts/unicode2sms $BINDIR/unicode2smsecho "Installing config file"copy examples/smsd.conf.easy /etc/smsd.confecho "Creating minimum spool directories"makedir /var/spoolmakedir /var/spool/smsmakedir /var/spool/sms/incomingmakedir /var/spool/sms/outgoingmakedir /var/spool/sms/checkedecho "Installing start-script"SMS3SCRIPT=scripts/sms3if [ -d /etc/init.d ]; then copy scripts/sms3 /etc/init.d/sms3 SMS3SCRIPT=/etc/init.d/sms3elif [ -d /sbin/init.d ]; then copy scripts/sms3 /sbin/init.d/sms3 SMS3SCRIPT=/sbin/init.d/sms3else echo " I do not know where to copy scripts/sms3. Please find out yourself."fiecho ""echo "Example script files are not installed automatically."echo 'Please dont forget to edit /etc/smsd.conf.'if [ "$BINDIR" != "/usr/local/bin" ]; then echo "You have installed executables to $BINDIR," echo "you should manually edit $SMS3SCRIPT script."fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -