This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/bin/create_first_user.sh

14 lines
316 B
Bash
Executable File

#!/bin/bash
if [[ $# -ne 1 ]] ; then
echo Usage: $0 [username]
exit 1
fi
merb -i << EOF
a = Author.create :name => '$1', :password => 'password', :password_confirmation => 'password'
p = Permission.find_by_name('change_permissions')
p ||= Permission.create :name => 'change_permissions'
a.permissions << p
EOF