- #!/bin/bash
- # slperm - reset the permissions for files on SL Viewer
- # Copyright 2008 - Lex Berchot, Moraine, Second Life, United States.
- # All rights reserved.
- #
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions are
- # met:
- #
- # * Redistributions of source code must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- #
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- # set -ex # Turn debugging on
- INSTDIR=${INSTDIR:-/usr/local/games}
- VIEWER=SecondLife-i686-1.21.6.99587
- CWD=$(pwd)
- if [[ $UID -ne 0 ]]; then
- echo "sorry this script is intended to be run as root"
- exit 1
- else
- # Make sure the permission on the toplevel dir is right:
- cd ${INSTDIR} || exit 1
- chown -R root:root ${VIEWER}
- # Change to the viewer:
- cd ${VIEWER} || exit 1
- # Set the directories permission to normal:
- find . -type d -exec chmod 0755 {} \;
- # Set the permissions of files to normal defaults:
- find . \
- \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 700 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \;
- # Set the permissions of executables to normal defaults:
- find . \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
- # Return to the Dir we came from:
- cd ${CWD}
- fi
- echo "All Done, enjoy!"
- echo ""
- exit 0
- #EOF
Posted by Lex Berchot on Sat 25 Oct 22:30
report abuse | download | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.