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