slitaz-forge view chub/chub @ rev 711

Update pangolin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jan 01 18:26:56 2020 +0100 (2020-01-01)
parents fec794d4852f
children
line source
1 #!/bin/sh
2 #
3 # Chub admin utility - SliTaz Community HUB aka Chub is the server hosting
4 # all end users sites such as the website, doc, forum as well as Hg repos.
5 # This tiny utility can be run by a cron job or via the command line for
6 # maintenance tasks.
7 #
8 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
9 #
10 # Authors : Christophe Lincoln <pankso@slitaz.org>
11 #
13 [ -f "/etc/slitaz/chub.conf" ] && . /etc/slitaz/chub.conf
14 [ -f "chub.conf" ] && . ./chub.conf
16 usage() {
17 cat << EOT
19 Usage: $(basename $0) [command]
21 Commands:
22 stats Display some server stats
23 up-chub Update Chub web interface chub.slitaz.org
24 up-doc Update doc.slitaz.org Wiki template
25 rrd Update RRD graphs images
26 backup Backup MySQL DB and files"
28 EOT
29 }
31 case "$1" in
32 up-chub)
33 # Update Chub web interface from repo.
34 echo "Updating: chub.slitaz.org..."
35 cd $REPOS/slitaz-forge
36 hg pull -u
37 rm -rf $VHOST/*.* $VHOST/images/*.png
38 cp -a chub/web/* $VHOST ;;
39 up-doc)
40 # Update Wiki doc template from Hg.
41 echo "Updating Wiki documentation template..."
42 cd $REPOS/slitaz-forge
43 hg pull -u
44 cp -a doc/lib/tpl/* $DOC_LIB/tpl ;;
45 stats)
46 # Echo some stats.
47 echo "======== Disk usage ============="
48 df -h | grep ^/dev
49 echo "======== Memory usage ==========="
50 free -m | grep ^Mem
51 echo "======== Connected users ========"
52 who ;;
53 rrd)
54 echo "Making RRD graphs images..."
55 $VHOST/lib/makegraphs >/dev/null ;;
57 backup)
58 echo "TODO: backup MySQL, SCN files, etc" ;;
59 *)
60 usage ;;
61 esac
62 exit 0