slitaz-forge view pangolin/pangolin @ rev 107

Add small utils for pangolin
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 13 14:20:45 2012 +0100 (2012-03-13)
parents
children 3f188d62df9b
line source
1 #!/bin/sh
2 #
3 # Pangolin admin utility
4 #
5 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License
6 #
7 # Authors : Christophe Lincoln <pankso@slitaz.org>
8 #
10 REPOS="/home/slitaz/repos"
11 WWW="/home/slitaz/www"
12 WEBSITE="$WWW/website"
13 PYTHON_LIB="/usr/lib/python2.5"
15 usage() {
16 echo "\nUsage: $(basename $0) [command]
17 Commands:
18 up-www Update website http://www.slitaz.org/
19 up-hg Update Hg web interface http://hg.slitaz.org/
20 stats Display some server stats.
21 backup Backup MySQL DB and files\n"
22 }
24 case "$1" in
25 up-www)
26 # Update website from repo.
27 echo "Updating: www.slitaz.org..."
28 cd $WEBSITE && hg pull -u ;;
29 up-hg)
30 # Update hg.slitaz.org template.
31 echo -e "\nUpdating Mercurial template..."
32 cd $REPOS/slitaz-dev-tools && hg update
33 cp -a slitaz-mercurial-style/* $PYTHON_LIB/site-packages/mercurial
34 chown -R root.root $PYTHON_LIB/site-packages/mercurial/templates
35 echo "" ;;
36 stats)
37 # Echo some stats.
38 echo "======== Disk usage ============="
39 df -h | grep ^/dev
40 echo "======== Memory usage ==========="
41 free -m | grep ^Mem
42 echo "======== Connected users ========"
43 who ;;
44 backup)
45 echo "TODO: backup MySQL, SCN files, etc" ;;
46 *)
47 usage ;;
48 esac
49 exit 0