Skip to content

Commit

Permalink
add /usr/bin/cmupdate command in 123.09beta01
Browse files Browse the repository at this point in the history
- typing command in SSH: cmupdate
- equivalent to running centmin.sh menu option 23 submenu option 2
  • Loading branch information
centminmod committed Nov 22, 2017
1 parent 882f6c5 commit 1ba6585
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
10 changes: 10 additions & 0 deletions inc/cpcheck.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,14 @@ nvcheck() {
fi
}

cmupdatecheck() {
if [ ! -h /usr/bin/cmupdate ]; then
rm -rf /usr/bin/cmupdate
ln -s "${SCRIPT_DIR}/tools/cmupdate.sh" /usr/bin/cmupdate
chmod +x /usr/bin/cmupdate
fi
}

dmotdcheck() {
if [ ! -h /usr/local/bin/dmotd ]; then
if [ -f "${SCRIPT_DIR}/config/motd/dmotd.sh" ]; then
Expand Down Expand Up @@ -2014,6 +2022,7 @@ kernelchecks
pathfixes
apache_protect
setup_pwdh
cmupdatecheck

if [[ "$INITIALINSTALL" != [yY] ]]; then
expand_cmdprompt
Expand All @@ -2035,6 +2044,7 @@ if [[ "$INITIALINSTALL" != [yY] ]]; then
checkcmdircmd
# dmotdcheck
nvcheck
cmupdatecheck
multiphpcheck
mjemalloc
blockeditorcheck
Expand Down
43 changes: 43 additions & 0 deletions tools/cmupdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
######################################################
# cmupdate
# written by George Liu (eva2000) centminmod.com
######################################################
# variables
MAINDIR='/etc/centminmod'
CM_INSTALLDIR='/usr/local/src/centminmod'
#############
if [ -f "${MAINDIR}/custom_config.inc" ]; then
# default is at /etc/centminmod/custom_config.inc
source "${MAINDIR}/custom_config.inc"
fi

# variables
#############


DT=$(date +"%d%m%y-%H%M%S")
######################################################
# functions
#############
# set locale temporarily to english
# due to some non-english locale issues
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8

fupdate() {
if [[ -d "${CM_INSTALLDIR}/.git" ]]; then
cd "${CM_INSTALLDIR}"
git stash
git pull
fi
}

######################################################
fupdate

exit


0 comments on commit 1ba6585

Please sign in to comment.