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,24 +14,26 @@ fi ...@@ -14,24 +14,26 @@ 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
for user in pwrp skiftel b55 b66; do if [ "$remove_all" = "y" ]; then
getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null for user in pwrp skiftel b55 b66; do
echo "-- Removed user ${user}" getent passwd ${user} >/dev/null 2>&1 && userdel -rf ${user} 2>/dev/null
done echo "-- Removed user ${user}"
for grp in pwrp skiftel b55 b66; do done
getent group ${grp} >/dev/null 2>&1 && groupdel ${grp} for grp in pwrp skiftel b55 b66; do
echo "-- Removed group ${grp}" getent group ${grp} >/dev/null 2>&1 && groupdel ${grp}
done echo "-- Removed group ${grp}"
echo "-- Removing projects..." done
if [ -e $proot ]; then echo "-- Removing projects..."
rm -r $proot && echo "-- Removed project $proot" if [ -e $proot ]; then
fi rm -r $proot && echo "-- Removed project $proot"
if [ -e $aroot ]; then fi
rm -r $aroot && echo "-- Removed admin directory $proot" if [ -e $aroot ]; then
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