summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-01-21 12:14:56 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-01-21 12:14:56 +1300
commita9a7b3946b8ae30d2d723a720b386eab2014d0c5 (patch)
treefa7fd6e24f71d42ac58e233fc09f9d801be8b989
parente4be4b8d0bba0163802fb03223f98b134fd718f1 (diff)
parent5aa486337b7ceb9c65983642c798cfeb2133d261 (diff)
downloadlightdm-git-a9a7b3946b8ae30d2d723a720b386eab2014d0c5.tar.gz
Rename variables to make script compatible with Bash
-rw-r--r--debian/guest-account.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/debian/guest-account.sh b/debian/guest-account.sh
index 60908984..6da56878 100644
--- a/debian/guest-account.sh
+++ b/debian/guest-account.sh
@@ -119,46 +119,46 @@ add_account ()
remove_account ()
{
- USER=$1
+ GUEST_USER=$1
- PWENT=`getent passwd "$USER"` || {
- echo "Error: invalid user $USER"
+ PWENT=`getent passwd "$GUEST_USER"` || {
+ echo "Error: invalid user $GUEST_USER"
exit 1
}
- UID=`echo "$PWENT" | cut -f3 -d:`
- HOME=`echo "$PWENT" | cut -f6 -d:`
+ GUEST_UID=`echo "$PWENT" | cut -f3 -d:`
+ GUEST_HOME=`echo "$PWENT" | cut -f6 -d:`
- if [ "$UID" -ge 500 ]; then
- echo "Error: user $USER is not a system user."
+ if [ "$GUEST_UID" -ge 500 ]; then
+ echo "Error: user $GUEST_USER is not a system user."
exit 1
fi
- if [ "${HOME}" = "${HOME#/tmp/}" ]; then
- echo "Error: home directory $HOME is not in /tmp/."
+ if [ "${GUEST_HOME}" = "${GUEST_HOME#/tmp/}" ]; then
+ echo "Error: home directory $GUEST_HOME is not in /tmp/."
exit 1
fi
# kill all remaining processes
- while ps h -u "$USER" >/dev/null; do
- killall -9 -u "$USER" || true
+ while ps h -u "$GUEST_USER" >/dev/null; do
+ killall -9 -u "$GUEST_USER" || true
sleep 0.2;
done
- umount "$HOME" || umount -l "$HOME" || true
- rm -rf "$HOME"
+ umount "$GUEST_HOME" || umount -l "$GUEST_HOME" || true
+ rm -rf "$GUEST_HOME"
# remove leftovers in /tmp
- find /tmp -mindepth 1 -maxdepth 1 -uid "$UID" -print0 | xargs -0 rm -rf || true
+ find /tmp -mindepth 1 -maxdepth 1 -uid "$GUEST_UID" -print0 | xargs -0 rm -rf || true
# remove possible /media/guest-XXXXXX folder
- if [ -d /media/"$USER" ]; then
- for dir in $( find /media/"$USER" -mindepth 1 -maxdepth 1 ); do
+ if [ -d /media/"$GUEST_USER" ]; then
+ for dir in $( find /media/"$GUEST_USER" -mindepth 1 -maxdepth 1 ); do
umount "$dir" || true
done
- rmdir /media/"$USER" || true
+ rmdir /media/"$GUEST_USER" || true
fi
- deluser --system "$USER"
+ deluser --system "$GUEST_USER"
}
case "$1" in