-
Notifications
You must be signed in to change notification settings - Fork 0
/
omni-cli.sh
32 lines (32 loc) · 1.41 KB
/
omni-cli.sh
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
#!/bin/sh
#
##
## Goal
##
#
# The point here is to provide a command-line interface to managing systems for the omni oakland collective.
# To start, the goal is to add users to email lists and generate user accounts on various web systems.
# This script is intended to be run locally and should only require access to the server(s) in question.
#
##
## Pseudocode
##
#
# 1. Ask for:
# + username
# + password (default random-generated e.g. xkcd style)
xkcdpass="shuf -n4 /usr/share/dict/words | tr -d '\n'"
# + email
# 2. Create accounts
# + WordPress
# - use wp-cli or similar https://github.com/wp-cli/wp-cli
# - probably wp-cli-ssh is perfect for one-liner https://github.com/x-team/wp-cli-ssh
#
wordpressuser="ssh sudoroom.org -e 'cd /var/www/sudoroom.org/public_html/ && wp $username $email --user_pass=$password'"
#
# + MediaWiki
# - Modify maintenance/createAndPromote.php script as recommended here https://stackoverflow.com/questions/928594/script-to-add-user-to-mediawiki
# - See createUserWithEmail.php in this directory, extends to include and validate email address.
#
mediawikiscript="scp ./scripts/mediawiki/createUserWithEmail.php sudoroom.org:/var/www/sudoroom.org/public_html/mediawiki/maintenance/createUserWithEmail.php"
mediawikiuser="ssh sudoroom.org -e 'cd /var/www/sudoroom.org/public_html/mediawiki/maintenance && php createUserWithEmail.php $username $password $email'"