not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / ksmserver / move_session_config.sh
blobe4fdb671bf624709e37bf5356cff0c960a487d2b
1 #!/bin/sh
3 prefix=`kde4-config --localprefix`
4 source="${prefix}/share/config"
5 dest="${prefix}/share/config/session"
7 # move session config files
9 if [ -n "$prefix" -a -d "$source" ]; then
10 while [ ! -d "$dest" ]; do
11 dir="$dest"
12 while [ ! -d `dirname "$dir"` ]; do
13 dir=`dirname "$dir"`
14 done
15 mkdir "$dir" || exit 1
16 done
18 files=`eval ls -1 "$source/*:[0-9a-f]*" 2> /dev/null`
19 if [ -n "$files" ]; then
20 for i in $files; do
21 origfile=`basename "$i"`
22 newfile=`echo "$origfile" | sed -e 's^:^_^'`
23 if [ -n "$newfile" -a ! -e "$dest/$newfile" ]; then
24 mv "$source/$origfile" "$dest/$newfile"
26 done
30 # update references in ksmserverrc
32 sed -e 's^share/config/\([^/:]*\):^share/config/session/\1_^'