Skip to content

Commit

Permalink
Add: update command
Browse files Browse the repository at this point in the history
  • Loading branch information
sekedus committed Jun 6, 2024
1 parent acebd2d commit e6b98e8
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ cd ~/tamp && bash setup && cd ~/
- tamp start
- tamp start-ssl
- tamp stop
- tamp update
- tamp uninstall

## Credits
Expand Down
5 changes: 3 additions & 2 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ fi
cd ~/tamp && cp -f config.inc.php /sdcard/htdocs/phpmyadmin/config.inc.php

YELLOW='\033[0;33m'
NC='\033[0m' # No Color
echo "TAMP installed sucessfully."
echo "/sdcard/htdocs - is your document directory."
echo "Place your files in /sdcard/htdocs"
echo -e "Run: ${YELLOW}tamp start"
echo -e "Run: ${YELLOW}tamp start${NC}"

#tamp
#tamp-setup
29 changes: 25 additions & 4 deletions tamp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ stop)
apachectl stop
pgrep mariadb && pkill mariadb
;;
update)
if [ ! -d ~/tamp ];
then
echo "TAMP directory not found."
git clone https://github.com/sekedus/tamp.git
fi
cd $HOME/tamp
git remote update
STATUS=$(git status -uno | grep 'Your branch is up to date')
echo "Check for TAMP updates.."
if [ -z "$STATUS" ]; then
git reset --hard HEAD
git pull
sh update
else
echo "\033[0;33mAlready up to date.\033[0m"
fi
;;
uninstall)
echo "Are you absolutely sure?"
echo ""
Expand All @@ -61,8 +79,11 @@ uninstall)
echo "by github.com/sekedus"
echo " "
echo "commands:"
echo " start Start tamp, localhost:8080"
echo " start-ssl Start tamp with SSL, port :8443"
echo " stop Stop tamp"
echo " uninstall Uninstall tamp"
echo " start Start TAMP, localhost:8080"
echo " start-ssl Start TAMP with SSL, port :8443"
echo " stop Stop TAMP"
echo " update Update TAMP"
echo " uninstall Uninstall TAMP"
esac

# tamp
34 changes: 34 additions & 0 deletions update
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!$PREFIX/bin/bash
BLUE='\033[0;34m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

apachectl stop

pgrep mariadb && pkill mariadb

echo "${BLUE}Updating TAMP..${NC}"

rm $PREFIX/etc/apache2/httpd.conf

cp httpd.conf $PREFIX/etc/apache2/

rm $PREFIX/etc/apache2/extra/httpd-ssl.conf

cp httpd-ssl.conf $PREFIX/etc/apache2/extra/

rm $PREFIX/bin/tamp

chmod +x tamp

cp tamp $PREFIX/bin/

cp -n .htaccess /sdcard/htdocs/

cp -n config.inc.php /sdcard/htdocs/phpmyadmin/config.inc.php

echo "${RED}Done!${NC}"
echo "${YELLOW}TAMP is up to date.${NC}"

#tamp-update

0 comments on commit e6b98e8

Please sign in to comment.