This repository has been archived on 2022-02-20. You can view files and clone it, but cannot push or open issues/pull-requests.
bash-shell-host/all/modules/lightdm/cpy.session.sh

28 lines
671 B
Bash
Raw Normal View History

#!/bin/bash
function confirm()
{
echo -n "$@ "
read -e answer
for response in y Y yes YES Yes Sure sure SURE OK ok Ok
do
if [ "_$answer" == "_$response" ]
then
return 0
fi
done
# Any answer other than the list above is considered a "no" answer
return 1
}
if [[ -d $HOME/.session ]]; then
echo $HOME/.session folder already exists
confirm "!overwrite??? (y/n)" || exit
/bin/cp -r -f $HOME/.session/ $HOME/.session-saved/
echo saved copy first to $HOME/.session-saved
fi
echo copying .session from $(pwd) to $HOME
/bin/cp -r -f .session/ $HOME
echo setting execute permissions
chmod +x $HOME/.session/*