-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlo2e
executable file
·36 lines (32 loc) · 859 Bytes
/
lo2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# 2018-01-13
# Feeder to the slo queue (Lots of files Opener)
# Use as: lo2e <part of filename(s)>
if ! pgrep -x "slo" > /dev/null
then
echo "I need the slo server running but it's apparently not."
fi
if [[ "$1" == "http://"* ]] || [[ "$1" == "https://"* ]]
then
echo "$1" >> $HOME/.slo/2p.txt
#silent_cpucsekk #No need to wait if writing at end of file
else
for j in "$@"
do
for i in *$j*
do
#k=`date +%N`
k=`date +%y%m%d_%H%M%S`_`strings /dev/urandom | tr -dc a-z-0-9 | tr -d - | head -c5`
# Alpine is crazy
clfn=${i//\*/}
veg=${clfn##*.}
elej=${clfn%.*}
#gnome-terminal -e "bash -c 'echo "$clfn"; exec bash'"
clfnr="${elej}_${k}.${veg}"
pfn=${clfnr##*/}
cp "$clfn" $HOME/.slo/2p/"$pfn"
echo "$pfn" >> $HOME/.slo/2p.txt
#silent_cpucsekk #No need to wait if writing at end of file
done
done
fi