Commit bf4f9698 authored by Mijian Xu's avatar Mijian Xu 😷
Browse files

Update install.sh

parent 4140ab72
......@@ -40,9 +40,17 @@ except:
import ConfigParser
config = ConfigParser.ConfigParser()
head = ''
argv = sys.argv[1:]
for o in argv:
if os.path.isfile(o):
head = o
argv.remove(o)
break
try:
opts,args = getopt.getopt(sys.argv[1:], "hN:S:C:Y:B:L:c:F:P:")
opts,args = getopt.getopt(argv, "hN:S:C:Y:B:L:c:F:P:")
print(argv)
except:
print('Arguments are not found!')
Usage()
......@@ -89,12 +97,7 @@ for op, value in opts:
Usage()
sys.exit(1)
head = []
for o in sys.argv[1:]:
if os.path.isfile(o):
head = o
break
if head == []:
if head == '':
print("Head file are not exist!")
Usage()
sys.exit(1)
......
......@@ -9,7 +9,7 @@
def Usage():
print('Usage:')
print('python bqmail_conti.py -Istation.lst -Yyear1/month1/day1/year2/month2/day2 -Cchannel -Hhour -Fformat head.cfg')
print('python bqmail_conti.py -Istation.lst -Yyear1/month1/day1/year2/month2/day2 -Hhour [-Cchannel] [-Fformat] head.cfg')
print('-I -- Station list. format: Network station')
print('-Y -- Date range.')
print('-C -- Channel (e.g., ?H?, HHZ, BH?). Default: BH?')
......@@ -30,9 +30,16 @@ except:
import ConfigParser
config = ConfigParser.ConfigParser()
head = ''
argv = sys.argv[1:]
for o in argv:
if os.path.isfile(o):
head = o
argv.remove(o)
break
try:
opts,args = getopt.getopt(sys.argv[1:], "hI:C:Y:H:F:")
opts,args = getopt.getopt(argv, "hI:C:Y:H:F:")
except:
print('Arguments are not found!')
Usage()
......@@ -61,12 +68,7 @@ for op, value in opts:
Usage()
sys.exit(1)
head = []
for o in sys.argv[1:]:
if os.path.isfile(o):
head = o
break
if head == []:
if head == '':
print("Head file are not exist!")
Usage()
sys.exit(1)
......
......@@ -5,8 +5,22 @@ ln -s `pwd`/searchDMC.py `pwd`/bin/searchDMC
ln -s `pwd`/updateCatalog.py `pwd`/bin/updateCatalog
ln -s `pwd`/bqmail_conti.py `pwd`/bin/bqmail_conti
if [ `uname` == "Darwin" ]; then
echo "export PATH=`pwd`/bin:\$PATH" >> ~/.bash_profile
if grep "export PATH=`pwd`/bin:\$PATH" ~/.bash_profile
then
echo "BQMail was already installed."
else
echo "# BQMail" >> ~/.bash_profile
echo "export PATH=`pwd`/bin:\$PATH" >> ~/.bash_profile
echo "Successfully install the BQMail."
fi
else
echo "export PATH=`pwd`/bin:\$PATH" >> ~/.bashrc
if grep "export PATH=`pwd`/bin:\$PATH" ~/.bashrc
then
echo "BQMail was already installed."
else
echo "# BQMail" >> ~/.bashrc
echo "export PATH=`pwd`/bin:\$PATH" >> ~/.bashrc
echo "Successfully install the BQMail."
fi
fi
exec $SHELL -l
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment