-
Notifications
You must be signed in to change notification settings - Fork 0
/
SWELL-linux.sh
200 lines (183 loc) · 4.74 KB
/
SWELL-linux.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#!/bin/bash
# CopyRight Notice Block
: '
-------------------------------------------
Name: SWELL 'Starbound Workshop Easy Linker Linux'
Version: 1.0.8
Created by: Misunderstood Wookiee
Contributors: NovaCrypt
CopyRight: (c) Apr 2023, All Rights Reserved!
--------------------------------------------
'
# End of CopyRight Notice Block
# START OF SCRIPT
clear
# STEAM APPS AND DEDICATED SERVER MODS DIRECTORY CONFIGURATION
# *** TO CHANGE: EDIT AFTER THE EQUALS SIGN
SteamAppsDir="${HOME}/.local/share/Steam/steamapps"
DediServerModDir="${HOME}/.local/share/Steam/steamapps/common/Starbound Dedicated Server/mods"
# MENU SELECTION SUB-ROUTINES BLOCK
function1() {
# begin symbolic linking section
clear
# Create Links for Content.pak
for directory in "${SteamAppsDir}/workshop/content/211820/"*; do
target="${directory}/content.pak"
link="${DediServerModDir}/${directory##*/}.pak"
if [[ -e $target ]]; then
if [[ ! -e $link ]]; then
ln -s "$target" "$link"
else
echo $link already exists.
fi
fi
done
# Create Links for Contents.pak
for directory in "${SteamAppsDir}/workshop/content/211820/"*; do
target="${directory}/contents.pak"
link="${DediServerModDir}/${directory##*/}.pak"
if [[ -e $target ]]; then
if [[ ! -e $link ]]; then
ln -s "$target" "$link"
else
echo $link already exists.
fi
fi
done
# clear
echo "
==============S.A.I.L================
Symbolic Link Process Completed
-------------------------------------
======PRESS ANY KEY TO CONTINUE======
"
read
# end of symbolic linking section
menu
}
function2() {
# begin copying files section
clear
# Copy content.pak
for directory in "${SteamAppsDir}/workshop/content/211820/"*; do
file="${directory}/content.pak"
dest="${DediServerModDir}/${directory##*/}.pak"
if [[ -e $file ]]; then
if [[ ! -e $dest ]]; then
cp "$file" "$dest"
else
echo $dest already exists.
fi
else
echo $file does not exist.
fi
done
# Copy contents.pak
for directory in "${SteamAppsDir}/workshop/content/211820/"*; do
file="${directory}/contents.pak"
dest="${DediServerModDir}/${directory##*/}.pak"
if [[ -e $file ]]; then
if [[ ! -e $dest ]]; then
cp "$file" "$dest"
else
echo $dest already exists.
fi
fi
done
clear
echo
echo "
==============S.A.I.L================
Workshop Files Copied Succesfully
-------------------------------------
======PRESS ANY KEY TO CONTINUE======
"
read
# end of copying files section
menu
}
function3() {
# begin print copy copyright section
clear
echo "
*********************************************
COPYRIGHT AND DISTRIBUTION
*********************************************
___________________________________________________________________________
You have permission to distrubute this program without any alteration and
the copyright notice block is included without changes.
___________________________________________________________________________
However you may -
Decompile, and edit for personal use but NOT distribute
altered versions of this program without permission from the author!
___________________________________________________________________________
---------------------------------------------
Created by: Misunderstood Wookiee
Contributors: Novacrypt
CopyRight: (c) Apr 2023, All Rights Reserved!
---------------------------------------------
======PRESS ANY KEY TO RETURN TO MAIN MENU======
"
read
# end of copyright print section
menu
}
quit() {
# begin quit section
clear
echo "
==============S.A.I.L===============
__________SHUTTING DOWN!____________
-------------------------------------
======PRESS ANY KEY TO QUIT======
"
read
exit
# end of quit section - if it has not quit by now WTF and well just WTF!
}
# END OF BLOCK
# PRINT MAIN MENU
menu() {
clear
echo "
_____________Starbound Workshop Easy Linker ______________
______________________ Main Menu _________________________
1. Create Workshop Mod Links
2. Create a Copy of Workshop Mods
3. Credits
-------------------------------------
__________PRESS 'Q' TO QUIT__________
"
# END OF BLOCK
# MENU CHOICE SUB-ROUTINE BLOCK
echo "Please select a number:"
read -n 1 input
if [[ "$input" == "1" ]]; then
function1
elif [[ "$input" == "2" ]]; then
function2
elif [[ "$input" == "3" ]]; then
function3
elif [[ "$input" == "q" ]]; then
quit
else
# if no valid selection print this -
clear
echo "
============INVALID INPUT============
*************************************
Please select a number from the Main Menu
[1-3] or select 'Q' to quit.
*************************************
======PRESS ANY KEY TO CONTINUE======
"
read
menu
fi
}
# END OF BLOCK
if [[ ! -e $DediServerModDir ]]; then
mkdir -r $DediServerModDir
fi
menu
# SCRIPT ENDS HERE