base version of dotfile archival script
This commit is contained in:
parent
75a40816e5
commit
0c430087e7
21
dotfiles-achive
Normal file
21
dotfiles-achive
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# What?
|
||||||
|
# Script which copies all dotfiles specified in locs.conf file into a new directory "dotfiles"
|
||||||
|
|
||||||
|
locations=locs.conf
|
||||||
|
output=dotfiles/
|
||||||
|
|
||||||
|
if [ ! -f "$locations" ];then
|
||||||
|
echo 'Missing locs.conf file to read dotfile locations from'
|
||||||
|
fi
|
||||||
|
mkdir -p $output
|
||||||
|
|
||||||
|
while read line; do
|
||||||
|
if [ ! -z "$line" ]; then
|
||||||
|
base="`dirname $line`"
|
||||||
|
mkdir -p "$output/$base"
|
||||||
|
cp "$line" "$output/$base"
|
||||||
|
fi
|
||||||
|
done < $locations
|
||||||
|
|
Loading…
Reference in New Issue
Block a user