[fix] alternc.install should have a --no-fixperms option + help + usage
This commit is contained in:
parent
6e9c3c3c63
commit
7a69abd660
|
@ -28,8 +28,25 @@ if [ `id -u` -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
usage(){
|
||||||
|
declare -a out
|
||||||
|
[[ $# -ne 0 ]] && out+=("\e[31mWarning: $@ \e[0m")
|
||||||
|
out+=("
|
||||||
|
Usage: ${BASH_SOURCE[0]} [options]
|
||||||
|
-n|--no-fixperms Skip the -often long- fixperms action
|
||||||
|
-f|--force Force the execution even if some files changed
|
||||||
|
-s|--slave Mandatory on instances runnning the alternc-slave module
|
||||||
|
-h|--help This help
|
||||||
|
")
|
||||||
|
echo -e "${out[@]}"
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
for i in $*; do
|
for i in $*; do
|
||||||
case "$i" in
|
case "$i" in
|
||||||
|
-h|--help)
|
||||||
|
usage; shift;;
|
||||||
|
-n|--no-fixperms)
|
||||||
|
export nofixperms=1; shift;;
|
||||||
-f|--force)
|
-f|--force)
|
||||||
export force=1; shift;;
|
export force=1; shift;;
|
||||||
-s|--slave)
|
-s|--slave)
|
||||||
|
@ -37,7 +54,7 @@ for i in $*; do
|
||||||
--)
|
--)
|
||||||
break;;
|
break;;
|
||||||
*)
|
*)
|
||||||
echo "unknown option $i"; shift;;
|
usage "unknown option '$i'!";
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -636,11 +653,14 @@ for service in $SERVICES; do
|
||||||
test -x /etc/init.d/$service && invoke-rc.d $service start || true
|
test -x /etc/init.d/$service && invoke-rc.d $service start || true
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $nofixperms -ne 1 ]] ; then
|
||||||
echo "Fix all the permission. May be quite long..."
|
echo "Fix all the permission. May be quite long..."
|
||||||
echo "YOU CAN INTERUPT THIS BY USING Ctrl-c THEN y TO BYPASS THE ERROR."
|
echo "YOU CAN INTERUPT THIS BY USING Ctrl-c THEN y TO BYPASS THE ERROR."
|
||||||
/usr/lib/alternc/fixperms.sh
|
/usr/lib/alternc/fixperms.sh
|
||||||
echo "Compile PO files"
|
echo "Compile PO files"
|
||||||
|
else
|
||||||
|
echo -e "\nSkipping fixperms as requested\n"
|
||||||
|
fi
|
||||||
# TODO : includes the .MO in debian package ;)
|
# TODO : includes the .MO in debian package ;)
|
||||||
find /usr/share/alternc/panel/locales -maxdepth 1 -mindepth 1 -type d -name "*_*" | while read A
|
find /usr/share/alternc/panel/locales -maxdepth 1 -mindepth 1 -type d -name "*_*" | while read A
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in New Issue