Repository navigation
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·77 lines (71 loc) · 2.53 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·77 lines (71 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
VERSION='1.1'
APP_ROOT="/path/to/wrush"
TMP_WPCONFIG="/tmp/wrush_wp_vars.php"
PWD=`pwd`
ROOT="$PWD/wp-config.php"
case "$1" in
infos|blogs|crons|cron-posts|plugins)
if [ ! -f $ROOT ];
then
command echo "Wrush v$VERSION : Developped by Nassim A. (http://nassi.me)"
command echo "Wrush : You're not appear to be in Wordpress Path Installation"
exit 0
fi
# Create Temp WP-Config.php
command echo "<?php " > $TMP_WPCONFIG
command grep -i -e "define(" -e "table_prefix" $ROOT >> $TMP_WPCONFIG
command echo "?>" >> $TMP_WPCONFIG
command /usr/bin/php $APP_ROOT/wrush.php $1 $APP_ROOT $TMP_WPCONFIG "$@"
;;
version)
command echo "Wrush v$VERSION : Developped by Nassim A. (http://nassi.me)"
command echo "This tool is like Drupal's Drush but for Wordpress"
;;
requirements)
command echo "Wrush v$VERSION : Developped by Nassim A. (http://nassi.me)"
command echo "This tool needs :"
command echo "- PHP Client (v5.x or higher)"
command echo "- PHP Curl libraries"
command echo "- Wordpress installation"
command echo ""
command echo "Add 'wrush' to your bash profile like :"
command echo " alias wrush='$APP_ROOT/run.sh'"
command echo ""
command echo "Change run.sh variable APP_ROOT with your wrush root"
command echo "/!\ Be careful on noexec on your system mount /!\\"
command echo ""
;;
*)
command echo "Wrush v$VERSION : Developped by Nassim A. (http://nassi.me)"
command echo "This tool is like Drupal's Drush but for Wordpress"
command echo "-----------------------------------------------------------"
command echo "Usage : wrush (blogs|crons|plugins|infos|requirements|version) [OPTIONS] "
command echo ""
command echo "blogs - Show blogs list available in your instance"
command echo "Options : none"
command echo ""
command echo "crons - Launch planified tasks"
command echo "Options :"
command echo "wrush crons [all|(http://)domain.tld(/blog)] [user:password]"
command echo ""
command echo "cron-posts - Publish scheduled posts"
command echo "Options :"
command echo "none"
command echo ""
command echo "plugins - Get enabled plugins"
command echo "Options : none"
command echo ""
command echo "infos - Get basic informations about your Wordpres installation"
command echo "Options : none"
command echo ""
command echo "requirements - Show requirements for good utilisation of Wrush"
command echo "Options : none"
command echo ""
command echo "version - Show Wrush version"
command echo "Options : none"
command echo ""
exit 2
;;
esac
exit 0