Fixes on deployment

This commit is contained in:
Marc Aymerich 2015-10-02 12:39:04 +00:00
parent d05a74ca88
commit e25fe305f0
1 changed files with 16 additions and 4 deletions

View File

@ -30,8 +30,14 @@ function main () {
exit 1
}
noinput='--noinput'
alias run=run_
alias surun=su_run
run () {
echo " ${bold}\$ ${@}${normal}"
${@}
}
surun () {
echo " ${bold}\$ su $user -c \"${@}\"${normal}"
su $user -c "${@}"
}
user=$2
elif [[ $# -eq 1 ]]; then
if [[ $1 != '--noinput' ]]; then
@ -45,8 +51,14 @@ function main () {
echo -e "\nErr. This script should run as a regular user\n" >&2
exit 1
}
alias run=run_
alias surun=surun_
run () {
echo " ${bold}\$ ${@}${normal}"
${@}
}
surun () {
echo " ${bold}\$ ${@}${normal}"
${@}
}
# Test sudo privileges
sudo true
fi