Commit ab1e6d83 authored by Marcus Nordenberg's avatar Marcus Nordenberg Committed by Esteban Blanc

pkg: fixed some issues with pwrrt package

(cherry picked from commit d9b814bae42600f4cf722d635f46c883c31c3525)
parent 5b5d1256
...@@ -92,6 +92,7 @@ else ...@@ -92,6 +92,7 @@ else
fi fi
fi fi
# Add the user b66
if getent passwd b66 >/dev/null; then if getent passwd b66 >/dev/null; then
echo "-- User b66 already exist. OK!" echo "-- User b66 already exist. OK!"
else else
...@@ -143,14 +144,12 @@ if [ ! -e /etc/proview.cnf ]; then ...@@ -143,14 +144,12 @@ if [ ! -e /etc/proview.cnf ]; then
new_cnf=1 new_cnf=1
fi fi
# Source pwrp_profile from both profile and bash.bashrc # Source pwrp_profile in login shells
for cnf_file in /etc/profile /etc/bash.bashrc; do if [ ! -e /etc/profile/pwrp_profile.sh ]; then
if ! grep -q "/etc/pwrp_profile\b" ${cnf_file}; then # profile.d should always exist on a modern debian system. BUT if it doesn't we create it :)
cat >> ${cnf_file} <<-EOF if [ ! -e /etc/profile.d ]; then mkdir /etc/profile.d; fi
[[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile echo "[[ -e /etc/pwrp_profile ]] && . /etc/pwrp_profile" > /etc/profile.d/pwrp_profile.sh
EOF fi
fi
done
# Create startup link # Create startup link
# set +e # set +e
......
...@@ -7,3 +7,5 @@ if [ "$1" = "purge" -a -e /etc/proview.cnf ]; then ...@@ -7,3 +7,5 @@ if [ "$1" = "purge" -a -e /etc/proview.cnf ]; then
rm /etc/proview.cnf rm /etc/proview.cnf
echo "-- Purged /etc/proview.cnf" echo "-- Purged /etc/proview.cnf"
fi fi
if [ -e /etc/profile.d/pwrp_profile.sh ]; then rm /etc/profile.d/pwrp_profile.sh; fi
...@@ -14,10 +14,11 @@ fi ...@@ -14,10 +14,11 @@ fi
proot="/pwrp" proot="/pwrp"
aroot="/usr/pwrp" aroot="/usr/pwrp"
echo "" if [ ! "$1" = "upgrade" ]; then
echo -n "Do you want to remove project and users (y/n) [n] " echo ""
read remove_all echo -n "Do you want to remove project and users (y/n) [n] "
if [ "$remove_all" = "y" ]; then read remove_all
if [ "$remove_all" = "y" ]; then
for user in pwrp skiftel b55 b66; do for user in pwrp skiftel b55 b66; do
getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null
echo "-- Removed user ${user}" echo "-- Removed user ${user}"
...@@ -31,7 +32,8 @@ if [ "$remove_all" = "y" ]; then ...@@ -31,7 +32,8 @@ if [ "$remove_all" = "y" ]; then
rm -r $proot && echo "-- Removed project $proot" rm -r $proot && echo "-- Removed project $proot"
fi fi
if [ -e $aroot ]; then if [ -e $aroot ]; then
rm -r $aroot && echo "-- Removed admin directory $proot" rm -r $aroot && echo "-- Removed admin directory $aroot"
fi
fi fi
fi fi
......
...@@ -19,7 +19,7 @@ export pwr_load=$pwrb_root/load ...@@ -19,7 +19,7 @@ export pwr_load=$pwrb_root/load
export pwr_lis=$pwrb_root/lis export pwr_lis=$pwrb_root/lis
export pwr_doc=$pwrb_root/doc export pwr_doc=$pwrb_root/doc
# Fetch arch # Fetch arch (In the rare cases where we run 32-bit proview on 64-bit debian)
if [ -e /pwrp ]; then if [ -e /pwrp ]; then
for dir in `ls -1 /pwrp`; do for dir in `ls -1 /pwrp`; do
[[ "${dir}" == "common" ]] && continue [[ "${dir}" == "common" ]] && continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment