#!/bin/bash
clear
echo " "
echo " "
echo " ''~'' "
echo " ( o o ) "
echo " +------------------.oooO--(_)--Oooo.------------------+ "
echo " | | "
echo " | LINUX.. BASH... | "
echo " | .oooO | "
echo " | ( ) Oooo. | "
echo " +---------------------\ (----( )--------------------+ "
echo " \_) ) / "
echo " (_/ "
echo " http://verklighetochdrom.blogspot.se/ "
echo " "
echo " hynt@speed-mailer.com "
# Check if user is is running as root. If not warning message, Exit
if [ $UID -ne 0 ]
then
echo -e "\033[31mYou MUST be root\033[m"
sleep 15
exit 0
fi
#[-Vem Är du-]------------------------------------------
function findUser() {
thisPID=$$
origUser=$(whoami)
thisUser=$origUser
while [ "$thisUser" = "$origUser" ]
do
ARR=($(ps h -p$thisPID -ouser,ppid;))
thisUser="${ARR[0]}"
myPPid="${ARR[1]}"
thisPID=$myPPid
done
getent passwd "$thisUser" | cut -d: -f1
}
user=$(findUser)
echo "logged in: $user"
#-------------------------------------------------------
sudo chown -R $user:$user /home/$user/.mozilla
echo "Rättigheter till .mozzila ändrade"
files=`find ~/.mozilla -name "*lock"`
for file in `echo $files`
do
echo "removing $file..."
rm "$file"
done
Inga kommentarer:
Skicka en kommentar