Blame view

tools/bin/komodo-modems-update-helper 526 Bytes
2f155ac47   Adhidarma Hadiwinoto   tools/bin dir
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  #!/bin/bash
  set -x
  
  #if [ -z "$2" ]; then
  #   echo Invalid arguments
  #   exit 1
  #fi
  
  [ -d /home/komodo/modems/$1 ] || { echo /home/komodo/modems/$1 does not exits; exit 1; }
  
  # [ -d $2 ] || { echo $2 does not exits; exit 1; }
  
  echo Processing $1
  cd /home/komodo/modems/$1 
  pwd
  echo Pulling for $1
  git pull
  
  [ -n "$2" ] && [ -d $2 ] && { 
      rm -rf /home/komodo/modems/$1/node_modules/;
      cp -r $2 /home/komodo/modems/$1
  }
  
  [ -f /home/komodo/modems/$1/pid.txt ] && kill `cat /home/komodo/modems/$1/pid.txt`
  echo $1 finished