2017-08-13 11:24:20 +08:00
|
|
|
diff -Naur a/Makefile b/Makefile
|
|
|
|
--- a/Makefile 2007-04-22 11:42:22.000000000 +0000
|
|
|
|
+++ b/Makefile 2017-08-10 22:14:15.011099622 +0000
|
2010-10-16 11:39:52 +08:00
|
|
|
@@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
# If you change destination of executables, remember to change
|
|
|
|
# startup script (init.d/sms3) too.
|
|
|
|
-BINDIR=/usr/local/bin
|
|
|
|
+BINDIR=/usr/bin
|
|
|
|
|
|
|
|
VERSION=$(shell grep package_version src/version.h | cut -f2)
|
|
|
|
|
2017-08-13 11:24:20 +08:00
|
|
|
diff -Naur a/install.sh b/install.sh
|
|
|
|
--- a/install.sh 2007-04-22 11:43:17.000000000 +0000
|
|
|
|
+++ b/install.sh 2017-08-10 22:18:11.561100240 +0000
|
|
|
|
@@ -3,9 +3,11 @@
|
2010-10-16 11:39:52 +08:00
|
|
|
|
2017-08-13 11:24:20 +08:00
|
|
|
BINDIR=$1
|
2010-10-16 11:39:52 +08:00
|
|
|
if [ -z "$BINDIR" ]; then
|
2017-08-13 11:24:20 +08:00
|
|
|
- BINDIR=/usr/local/bin
|
|
|
|
+ BINDIR=/usr/bin
|
2010-10-16 11:39:52 +08:00
|
|
|
fi
|
|
|
|
|
2017-08-13 11:24:20 +08:00
|
|
|
+SBINDIR=/usr/sbin
|
|
|
|
+
|
2010-10-16 11:39:52 +08:00
|
|
|
makepath()
|
|
|
|
{
|
2017-08-13 11:24:20 +08:00
|
|
|
p="$1"
|
|
|
|
@@ -33,10 +35,10 @@
|
|
|
|
{
|
|
|
|
if [ -f $2 ]; then
|
|
|
|
echo " Skipped $2, file already exists"
|
|
|
|
- else
|
|
|
|
+ else
|
|
|
|
echo " $2"
|
|
|
|
cp $1 $2
|
|
|
|
- fi
|
|
|
|
+ fi
|
|
|
|
}
|
|
|
|
|
|
|
|
forcecopy()
|
|
|
|
@@ -64,58 +66,39 @@
|
2010-10-16 11:39:52 +08:00
|
|
|
echo " Skipped $1, directory already exists"
|
|
|
|
else
|
|
|
|
echo " Creating directory $1"
|
|
|
|
- mkdir $1
|
|
|
|
+ mkdir -p $1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-08-13 11:24:20 +08:00
|
|
|
echo ""
|
|
|
|
-if [ ! -f src/smsd ] && [ ! -f src/smsd.exe ]; then
|
|
|
|
+if [ ! -f src/smsd ] && [ ! -f src/smsd.exe ]; then
|
|
|
|
echo 'Please run "make -s install" instead.'
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-10-16 11:39:52 +08:00
|
|
|
|
|
|
|
echo "Installing binary program files"
|
2017-08-13 11:24:20 +08:00
|
|
|
-makepath $BINDIR
|
|
|
|
-if [ -f src/smsd.exe ]; then
|
|
|
|
- forcecopy src/smsd.exe $BINDIR/smsd.exe
|
|
|
|
-else
|
2010-10-16 11:39:52 +08:00
|
|
|
- forcecopy src/smsd $BINDIR/smsd
|
2017-08-13 11:24:20 +08:00
|
|
|
-fi
|
|
|
|
-delete $BINDIR/getsms
|
|
|
|
-delete $BINDIR/putsms
|
|
|
|
+mkdir -p $DESTDIR/$BINDIR
|
|
|
|
+mkdir -p $DESTDIR/$SBINDIR
|
|
|
|
+forcecopy src/smsd $DESTDIR/$SBINDIR/smsd
|
2010-10-16 11:39:52 +08:00
|
|
|
|
2017-08-13 11:24:20 +08:00
|
|
|
echo "Installing some scripts"
|
|
|
|
-copy scripts/sendsms $BINDIR/sendsms
|
|
|
|
-copy scripts/sms2html $BINDIR/sms2html
|
|
|
|
-copy scripts/sms2unicode $BINDIR/sms2unicode
|
|
|
|
-copy scripts/unicode2sms $BINDIR/unicode2sms
|
|
|
|
-
|
2010-10-16 11:39:52 +08:00
|
|
|
-echo "Installing config file"
|
|
|
|
-copy examples/smsd.conf.easy /etc/smsd.conf
|
2017-08-13 11:24:20 +08:00
|
|
|
+copy scripts/sendsms $DESTDIR/$BINDIR/sendsms
|
|
|
|
+copy scripts/sms2html $DESTDIR/$BINDIR/sms2html
|
|
|
|
+copy scripts/sms2unicode $DESTDIR/$BINDIR/sms2unicode
|
|
|
|
+copy scripts/unicode2sms $DESTDIR/$BINDIR/unicode2sms
|
|
|
|
|
2010-10-16 11:39:52 +08:00
|
|
|
echo "Creating minimum spool directories"
|
|
|
|
-makedir /var/spool
|
|
|
|
-makedir /var/spool/sms
|
|
|
|
-makedir /var/spool/sms/incoming
|
|
|
|
-makedir /var/spool/sms/outgoing
|
|
|
|
-makedir /var/spool/sms/checked
|
|
|
|
+makedir $DESTDIR/var/spool
|
|
|
|
+makedir $DESTDIR/var/spool/sms
|
|
|
|
+makedir $DESTDIR/var/spool/sms/incoming
|
|
|
|
+makedir $DESTDIR/var/spool/sms/outgoing
|
|
|
|
+makedir $DESTDIR/var/spool/sms/checked
|
|
|
|
|
|
|
|
echo "Installing start-script"
|
|
|
|
-SMS3SCRIPT=scripts/sms3
|
|
|
|
-if [ -d /etc/init.d ]; then
|
|
|
|
- copy scripts/sms3 /etc/init.d/sms3
|
|
|
|
- SMS3SCRIPT=/etc/init.d/sms3
|
|
|
|
-elif [ -d /sbin/init.d ]; then
|
|
|
|
- copy scripts/sms3 /sbin/init.d/sms3
|
|
|
|
- SMS3SCRIPT=/sbin/init.d/sms3
|
|
|
|
-else
|
|
|
|
- echo " I do not know where to copy scripts/sms3. Please find out yourself."
|
|
|
|
-fi
|
|
|
|
+makedir $DESTDIR/etc/rc.d
|
|
|
|
+copy scripts/sms3 $DESTDIR/etc/rc.d/rc.sms3.new
|
|
|
|
+SMS3SCRIPT=/etc/rc.d/rc.sms3
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
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
|
2017-08-13 11:24:20 +08:00
|
|
|
diff -Naur a/scripts/sms3 b/scripts/sms3
|
|
|
|
--- a/scripts/sms3 2010-05-04 09:21:44.000000000 +0000
|
|
|
|
+++ b/scripts/sms3 2017-08-10 21:58:41.968097184 +0000
|
2010-10-16 11:39:52 +08:00
|
|
|
@@ -24,9 +24,9 @@
|
|
|
|
# Logfile can also be defined in here:
|
|
|
|
LOGFILE="/var/log/smsd.log"
|
|
|
|
|
|
|
|
-DAEMON=/usr/local/bin/smsd
|
2017-08-15 23:25:27 +08:00
|
|
|
+DAEMON=/usr/sbin/smsd
|
2010-10-16 11:39:52 +08:00
|
|
|
# A program which turns power off for couple of seconds:
|
|
|
|
-RESETMODEMS=/usr/local/bin/smsd_resetmodems
|
|
|
|
+RESETMODEMS=/usr/bin/smsd_resetmodems
|
|
|
|
NAME=smsd
|
|
|
|
PSOPT="-e"
|
|
|
|
ECHO=echo
|