Commit be2cf512 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add update_links_to_srv.sh

parent ff0f5bb3
#!/bin/sh
TOMOVE="Projects .npm .node-gyp .electron-gyp .composer python_packages"
for i in /home/* ; do
#for i in danil ; do
echo $i
U=$(basename $i)
test -n "$U" || continue
test -d "/home/$U/" || continue
test -d "/srv/$U/" || continue
for d in $TOMOVE ; do
test -d "/home/$U/$d" || continue
test -L "/home/$U/$d" && continue
test -e "/srv/$U/$d" && echo "Target /srv/$U/$d already exists, skipping..." && continue
echo "Moving $d ... to /srv/$U"
mv -v "/home/$U/$d" "/srv/$U" || exit
ln -s "/srv/$U/$d" "/home/$U/$d"
done
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment