Browse Source

Improve the update command

Bob Mottram 9 years ago
parent
commit
a2f70147de
1 changed files with 13 additions and 9 deletions
  1. 13
    9
      src/freedombone-upgrade

+ 13
- 9
src/freedombone-upgrade View File

28
 # You should have received a copy of the GNU General Public License
28
 # You should have received a copy of the GNU General Public License
29
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30
 
30
 
31
-FREEDOMBONE_REPO="https://github.com/bashrc/freedombone"
31
+PROJECT_NAME='freedombone'
32
+
33
+FREEDOMBONE_REPO="https://github.com/bashrc/${PROJECT_NAME}"
32
 
34
 
33
 update-ca-certificates
35
 update-ca-certificates
34
 
36
 
35
-if [ ! -d /root/freedombone ]; then
36
-  echo "    git clone $FREEDOMBONE_REPO /root/freedombone"
37
+if [ ! -d /root/${PROJECT_NAME} ]; then
38
+    git clone $FREEDOMBONE_REPO /root/${PROJECT_NAME}
37
 fi
39
 fi
38
 
40
 
39
-if [ -f /root/freedombone.cfg ]; then
40
-    cd /root/freedombone
41
-    git stash
42
-    git pull
43
-    make install
44
-    freedombone -c /root/freedombone.cfg
41
+if [ -d /root/${PROJECT_NAME} ]; then
42
+    if [ -f /root/${PROJECT_NAME}.cfg ]; then
43
+        cd /root/${PROJECT_NAME}
44
+        git stash
45
+        git pull
46
+        make install
47
+        ${PROJECT_NAME} -c /root/${PROJECT_NAME}.cfg
48
+    fi
45
 fi
49
 fi
46
 
50
 
47
 echo '
51
 echo '