-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathomvinstalls.sh
4880 lines (4420 loc) · 140 KB
/
omvinstalls.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
set -u
clear;
# My Junk Stuff #
################################################################################
#Setup Downloaders Miller style
#wget https://raw.github.com/cptjhmiller/OMV_Installers/master/omv.sh
#chmod a+x omv.sh
#./omv.sh
#3 5 8 9 10 11 12 15 16 17 18
# > /dev/null 2>&1
#sudo nano /etc/apt/sources.list
#at the end of the file add :
#Code: Select all
#deb http://ftp.debian.org/debian/ squeeze main contrib non-free
#change user #chown -hR $mainuser:$maingroup
#chown -R nobody:nogroup /usr/local/bin/SABnzbd-0.5.6
#adduser --disabled-login --gecos ,,,, --no-create-home downloaders > /dev/null 2>&1
#mkdir /home/downloaders > /dev/null 2>&1
#chown downloaders:downloaders -R/home/downloaders > /dev/null 2>&1
#Obtain the IP of the box
#useradd --user-group downloaders > /dev/null 2>&1
#git config --global http.proxy http://proxy:8080
#// To check the proxy settings
#git config --get http.proxy
#wget http://downloads.sourceforge.net/mediainfo/mediainfo_0.7.64-1_amd64.Debian_6.0.deb
#wget http://downloads.sourceforge.net/mediainfo/libmediainfo0_0.7.64-1_amd64.Debian_6.0.deb
#wget http://downloads.sourceforge.net/zenlib/libzen0_0.4.29-1_amd64.Debian_6.0.deb
#dpkg -i libzen0_0.4.29-1_amd64.Debian_6.0.deb
#dpkg -i libmediainfo0_0.7.64-1_amd64.Debian_6.0.deb
#dpkg -i mediainfo_0.7.64-1_amd64.Debian_6.0.deb
#rm libzen0_0.4.29-1_amd64.Debian_6.0.deb
#rm libmediainfo0_0.7.64-1_amd64.Debian_6.0.deb
#rm mediainfo_0.7.64-1_amd64.Debian_6.0.deb
################################################################################
###################
# SYSTEM varables #
###################
INSTALLDIR=""
mainuser="root"
maingroup="root"
OMV_V=`expr substr "$(cat /etc/issue)" 18 1`
. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions
#/usr/local/bin/python2.7
py="/usr/bin/python"
C_FILE=/etc/millers.cfg
PREFIX=MILLERSCONFIG
if [ ! -e $C_FILE ]; then
IP=`ifconfig | grep "inet addr:" | head -n 1 | cut -d':' -f2 | cut -d' ' -f1`
echo 'MILLERSCONFIG1=/
MILLERSCONFIG2='${IP}'
MILLERSCONFIG3=n' > $C_FILE
fi
save_variables()
{
set | grep ^$PREFIX
}
show_variables()
{
save_variables | while read line; do
echo $1 $line
done
}
. $C_FILE
ip=$MILLERSCONFIG2
INSTALLDIR=$MILLERSCONFIG1
screen()
{
clear;
echo "";
echo " -------------------------------Millers-------------------------------";
echo " OpenMediaVault Multi Application Installer V1.9.10 ";
echo "";
}
### Functions
f_aborted() {
whiptail --title "Script cancelled" --backtitle "$BACKTITLE" --msgbox " Aborted!" 7 32
exit 0
}
# simple log-output
f_log() {
echo "$1" >> $OMVLOGFILE
echo "$1"
}
Clean()
{
## Cleaning script to update OMV savely from 0.4 to 0.5
# R. Lindlein aka Solo0815 in the OMV-Forums
# v 0.8.0
# Bugs fixed / features added:
# - typo
# - added removing js-files from jhmiller's script
# - one date to rule them all ;)
# - creating directory - forget variable (stupid me)
# - only external plugins are removed
# - fixed error in the rename *.js-files section
# - added purging of the website plugin and omv-plugins.org
# - added moving millers.list because the containing linux-mint entries it gave errors with OMV 0.5
# - added removing other stuff from http://forums.openmediavault.org/viewtopic.php?f=14&t=2262&start=10#p15824
# - moved from sh to bash -> should resolve some errors with [[ ]] - changed it to single [
# - added code to get local.list back
###########################################################################################
SCRIPTDATE="$(date +%y%m%d-%H%M%S)"
TITLE="Clean OMV to upgrade from 0.4 to 0.5"
BACKTITLE="OMV-Upgrade-Cleaner"
OMVFOLDER_DEBS="/root/omv0.4_cleaning_for_0.5/"
OMVLOGFILE="/root/omv-0.5-cleaning_${SCRIPTDATE}.log"
OMVAPT="/etc/apt/sources.list.d"
OLDJSEXT="_omv0.4_$SCRIPTDATE"
###########################################################################################
### Begin of script
echo
whiptail --title "${TITLE}" --backtitle "${BACKTITLE}" --msgbox "This script will clean your OMV-Installation, so that you can upgrade from 0.4 to 0.5\n\nPlease read the following instructions carefully!" 11 78
whiptail --title "${TITLE}" --backtitle "${BACKTITLE}" --yesno --defaultno "To clean up your OMV-installation, the following steps are required:\n1. remove all external plugins.\n The config is still there\n2. rename *.js-files in $OMV_DOCUMENTROOT_DIR/js/omv/module and admin/\n3. move all *.deb files and local.list in $OMVAPT/\n4. move old-omvplugins.org-lists\n\nDo you want to do this?" 15 78
[ $? = 0 ] || f_aborted
whiptail --title "${TITLE}" --backtitle "${BACKTITLE}" --yesno --defaultno "You are using this script at your own risk!\n\nAre you ready to reinstall OMV if something goes wrong or this script isn't working as expected?" 11 78
[ $? = 0 ] || f_aborted
whiptail --title "${TITLE}" --backtitle "${BACKTITLE}" --yesno --defaultno "You know, what you are doing?\n\nLogfile is $OMVLOGFILE" 8 78
[ $? = 0 ] || f_aborted
f_log "Cleaning started - $SCRIPTDATE"
f_log ""
### 1. remove all external plugins
f_log "1. remove all non- OMV-plugins"
PLUGINSTOREMOVE=$(apt-cache search openmediavault- | awk '{print $1}'| egrep -v 'openmediavault-(clamav|forkeddaapd|iscsitarget|keyring|ldap|lvm2|netatalk|nut|route|usbbackup)')
if [ "$PLUGINSTOREMOVE" = "" ]; then
f_log "There are no external PlugIns installed! Nothing to do here!"
else
f_log "PlugIns to remove:"
f_log "$PLUGINSTOREMOVE"
f_log "Working ..."
# Website-Plugin has to be purged
if echo "$PLUGINSTOREMOVE" | egrep 'openmediavault-website'; then
f_log "removing OMV-Website Plugin ... --purge"
apt-get remove --purge -y -q openmediavault-website >> $OMVLOGFILE
fi
if echo "$PLUGINSTOREMOVE" | egrep 'openmediavault-omvpluginsorg'; then
f_log "removing openmediavault-omvpluginsorg ... --purge"
apt-get remove --purge -y -q openmediavault-omvpluginsorg >> $OMVLOGFILE
fi
f_log "removing normal PlugIns ..."
PLUGINSTOREMOVE_new="$(echo "$PLUGINSTOREMOVE" | egrep -v 'openmediavault-website|omv-plugins.org')"
apt-get remove -y -q $PLUGINSTOREMOVE_new >> $OMVLOGFILE
fi
sleep 1
f_log ""
### 2. rename *.js-files in $OMV_DOCUMENTROOT_DIR/js/omv/module/admin/"
f_log "2. rename *.js-files in $OMV_DOCUMENTROOT_DIR/js/omv/module/admin/"
if [ -f $OMV_DOCUMENTROOT_DIR/js/omv/module/admin/*.js ]; then
f_log "Your folder for js-files:"
ls $OMV_DOCUMENTROOT_DIR/js/omv/module/admin/*.js >> $OMVLOGFILE
for OLDJSFILES in "$OMV_DOCUMENTROOT_DIR/js/omv/module/admin/"*.js; do
mv "${OLDJSFILES}" "${OLDJSFILES}${OLDJSEXT}" && f_log "$OLDJSFILES renamed to ${OLDJSFILES}${OLDJSEXT}"
done
else
f_log "No old js-files in $OMV_DOCUMENTROOT_DIR/js/omv/module/admin found. Nothing to do here!"
fi
sleep 1
f_log ""
### 2a. Convert side panel items from OMV4 to OMV5
f_log "2a. Convert side panel items from OMV4 to OMV5"
sidepanel="AutoSub BicBucStriim CouchPotato CouchPotatoServer Deluge Extplorer GameZ HeadPhones LazyLibrarian Maraschino MusicCabinet MyLar PyLoad SABnzbd SickBeard SubSonic XDM"
for item in ${sidepanel[@]}; do
if [ -f /var/www/openmediavault/js/omv/module/"$item".js ]; then
f_log "Converting $item"
address=$(sed '/window.open("http:\/\//!d;s//&\n/;s/.*\n//;:a;/","/bb;$!{n;ba};:b;s//\n&/;P;D' /var/www/openmediavault/js/omv/module/$item.js) #)
rm -Rf /var/www/openmediavault/js/omv/module/$item.js
mkdir -p /millers_temp/service/$item
echo '/**
* This file is not part of OpenMediaVault.
*/
// require("js/omv/WorkspaceManager.js")
// require("js/omv/workspace/form/Panel.js")
/**
* @class OMV.module.admin.service.'${item}'.'${item}'
* @derived OMV.workspace.panel.Panel
*/
Ext.define("OMV.module.admin.service.'${item}'.'${item}'", {
extend: "Ext.panel.Panel",
initComponent: function() {
var me = this;
window.open("'${address}'","blank")
me.callParent(Ext.panel.panel);
},
});
OMV.WorkspaceManager.registerNode({
id: "'${item}'",
path: "/service",
text: _("'${item}'"),
icon16: "images/'${item}'.png",
});
OMV.WorkspaceManager.registerPanel({
path: "/service/'${item}'",
className: "OMV.module.admin.service.'${item}'.'${item}'"
});
' > /millers_temp/service/$item/$item.js
fi
done
if [ -d /millers_temp ]; then
#create startup script and call to script in rc.local
sed -i '0,/^[ \t]*exit[ \t]\+0/s//\/millers_temp\/script.sh\n&/' /etc/rc.local
echo '#!/bin/bash
OMV_V=`expr substr "$(cat /etc/issue)" 18 1`
if [ $OMV_V -gt 4 ]; then
cp -Ra /millers_temp/service/ /var/www/openmediavault/js/omv/module/admin/
#remove rc.local call
sed -i "s#/millers_temp/script.sh##g" /etc/rc.local
#delete script and temp folder
rm -Rf /millers_temp
#remove rc.local call
fi
exit 0' > /millers_temp/script.sh
chmod +x /millers_temp/script.sh
exit 0
fi
sleep 1
f_log ""
### 3. move all *.deb files in $OMVFOLDER_DEBS
f_log "3. move all *.deb and openmediavault-local.list in $OMVAPT/"
if [ ! -d $OMVFOLDER_DEBS ]; then
mkdir $OMVFOLDER_DEBS && f_log "$OMVFOLDER_DEBS created"
else
f_log "folder $OMVFOLDER_DEBS already exists!"
fi
if ls $OMV_DPKGARCHIVE_DIR/*.deb >/dev/null 2>&1; then
mv $OMV_DPKGARCHIVE_DIR/*.deb $OMVFOLDER_DEBS && f_log "moved all manually installed *.deb-files to $OMVFOLDER_DEBS"
else
f_log "No old deb-files in $OMV_DPKGARCHIVE_DIR found. Nothing to do here!"
fi
if ls $OMVAPT/openmediavault-local.list >/dev/null 2>&1; then
mv $OMVAPT/openmediavault-local.list $OMVFOLDER_DEBS && f_log "moved $OMVAPT/openmediavault-local.list to $OMVFOLDER_DEBS"
echo "deb file:$OMV_CACHE_DIR/archives /" > $OMVAPT/openmediavault-local.list && f_log "created a new $OMVAPT/openmediavault-local.list"
else
f_log "No file: $OMVAPT/openmediavault-local.list found. Nothing to do here!"
fi
sleep 1
f_log ""
### 4. move old-omvplugins.org-lists
f_log "4. move old-omvplugins.org-lists in $OMVAPT/"
if [ -f $OMVAPT/omv-plugins-org-* ]; then
mv $OMVAPT/omv-plugins-org-* $OMVFOLDER_DEBS && f_log "moved old omvplugins.org-lists in $OMVAPT/ to $OMVFOLDER_DEBS"
else
f_log "No old lists for omvplugins.org found in $OMVAPT/omv-plugins-org-* found. Nothing to do here!"
fi
if [ -f $OMVAPT/openmediavault-millers.list ]; then
mv $OMVAPT/openmediavault-millers.list $OMVFOLDER_DEBS && f_log "moved openmediavault-millers.list in $OMVAPT/ to $OMVFOLDER_DEBS"
else
f_log "No openmediavault-millers.list found in $OMVAPT. Nothing to do here!"
fi
sleep 1
f_log ""
### 5. clean other stuff
# from thread: http://forums.openmediavault.org/viewtopic.php?f=14&t=2262&start=10#p15824
f_log "5. Clean other stuff"
if [ -f /etc/apache2/openmediavault-webgui.d/git.conf ]; then
mv /etc/apache2/openmediavault-webgui.d/git.conf $OMVFOLDER_DEBS && f_log "moved git.conf in /etc/apache2/openmediavault-webgui.d/ to $OMVFOLDER_DEBS"
fi
if [ -f /etc/apache2/mods-enabled/authnz_external.load ]; then
mv /etc/apache2/mods-enabled/authnz_external.load $OMVFOLDER_DEBS && f_log "moved authnz_external.load in /etc/apache2/mods-enabled/ to $OMVFOLDER_DEBS"
fi
sleep 1
f_log ""
f_log "The cleaning of OMV 0.4 for upgrading to 0.5 was successfull! Please reboot. Then you can upgrade to 0.5 at your own risk via \"omv-release upgrade\""
echo
echo "The logfile is $OMVLOGFILE"
menu;
}
changelocation()
{
cd /
WHERE=""
selected=0
echo "";
while [[ "$selected" -eq 0 ]] ; do
screen;
echo
echo "Please choose the folder you wish to use for MOST applications.";
echo "Use the navigation system below to find the location you wish to use"
echo "and then confirm it by entering 0. If uninstalling you must choose"
echo "the same folder you installed to.";
count=-1 && echo "Current Selected Folder is: $(pwd)" && echo ""
# Listing content of directory in the GUI
for item in $(echo -e "$(pwd)\n..\n$(find -L -maxdepth 1 -type d -name [^\.]\* | sed 's:^\./::')"); do
count=$(( $count + 1 )); var_name="sel$count"; var_val="$item"; eval ${var_name}=`echo -e \""${var_val}"\"`; echo "$count - $item"
done
echo "" && echo "Type the ID of the Destination folder or 0 to select current folder:"
# Asking user for its selection
read answer && sel_item="$(echo "sel$answer")"
WHERE=${!sel_item}
if [ "$WHERE" == "Select current folder" ]; then INSTALLDIR="$(pwd)" && selected=1
elif [ "$answer" == "0" ]; then INSTALLDIR="$(pwd)" && selected=1
elif [ "$WHERE" == ".." ]; then cd "$(dirname $(pwd))"
elif [[ "$(pwd)" == "/" && -d "/$WHERE" ]]; then cd "/$WHERE"
elif [ -d "$(pwd)/$WHERE" ]; then cd "$(pwd)/$WHERE"
fi
echo ""
done
screen;
echo
if [ "$INSTALLDIR" == "/" ]
then
echo "You have chosen to install MOST apps to the root of your system drive";
INSTALLDIR=""
else
echo "You have chosen to install MOST apps to $INSTALLDIR";
fi
if QUESTION; then
. $C_FILE
MILLERSCONFIG1=$INSTALLDIR
save_variables > $C_FILE
menu;
else
changelocation;
fi
}
install_PYTHON()
{
if [ ! -e /usr/bin/python2.7 ]; then
t=9
appinstall="build-essential libsqlite3-dev libssl-dev ncurses-dev libreadline5-dev libncursesw5-dev libgdbm-dev libbz2-dev libc6-dev tk-dev libdb4.6-dev tk8.5 tk8.5-dev"
for item in ${appinstall[@]}; do
echo -ne $t% \\r
if [ ! -e /var/lib/dpkg/info/"$item".list ]; then
/usr/bin/apt-get -qq install "$item" > /dev/null 2>&1
t=$(($t + 7))
else
t=$(($t + 7))
fi
done
cd /tmp
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar zxvf Python-2.7.6.tgz
rm -f Python-2.7.6.tgz
cd Python-2.7.6
./configure
make altinstall
rm -f /usr/bin/python2.7-config
rm -f /usr/bin/python2.7
ln -s /usr/local/bin/python2.7 /usr/bin/python2.7
ln -s /usr/local/bin/python2.7-config /usr/bin/python2.7-config
wget http://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz --no-check-certificate
tar zxvf Cheetah-2.4.4.tar.gz
cd Cheetah-2.4.4
/usr/local/bin/python2.7 setup.py install
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.9.tar.gz --no-check-certificate
tar zxvf setuptools-0.9.tar.gz
cd setuptools-0.9
/usr/local/bin/python2.7 setup.py install
wget https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz --no-check-certificate
tar xzf pip-1.4.tar.gz
cd pip-1.4
/usr/local/bin/python2.7 setup.py install
wget http://sabnzbd.sourceforge.net/yenc-0.3.tar.gz
tar zxf yenc-0.3.tar.gz
cd yenc-0.3
/usr/local/bin/python2.7 setup.py install # Need to do this as admin
wget http://ftp.edgewall.com/pub/babel/Babel-0.9.6.tar.gz
tar xzf Babel-0.9.6.tar.gz
cd Babel-0.9.6
/usr/local/bin/python2.7 setup.py install
cd /
rm -Rf /tmp/Python-2.7.6
else
echo "Python2.7 has been found, skipping compiling.";
fi
}
changeip()
{
screen;
echo
echo "You should only need to change the default IP address if the IP you";
echo "see on the main menu screen is not the correct ip address for the";
echo "machine running OpenMediaVault or if it says localhost.";
echo "You want to alter the IP address?";
if ! QUESTION;then
menu;
fi
screen;
echo
echo "Please enter the correct server address below.";
echo "You should only enter a valid host name or IP address as there is no error checking.";
read -p "New IP/Host name: " ip
. $C_FILE
MILLERSCONFIG2=$ip
save_variables > $C_FILE
menu;
}
QUESTION()
{
read -p "Is this correct? (y/n)" -n 1
[[ ! $REPLY =~ ^[Yy]$ ]] || return 0
return 1
}
Uninstall_CouchPotatov1()
{
uinst="1"
echo "uninstalling................CouchPotato"
service CouchPotato stop > /dev/null 2>&1
update-rc.d -f CouchPotato remove > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/CouchPotato > /dev/null 2>&1
rm -fR $INSTALLDIR/CouchPotato > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/CouchPotato.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/CouchPotato.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/CouchPotato > /dev/null 2>&1
}
Uninstall_CouchPotatoServer()
{
uinst="1"
echo "uninstalling................CouchPotatoServer"
service CouchPotatoServer stop > /dev/null 2>&1
sleep 2
update-rc.d -f CouchPotatoServer remove > /dev/null 2>&1
rm -fR /etc/init.d/CouchPotatoServer > /dev/null 2>&1
rm -fR $INSTALLDIR/CouchPotatoServer > /dev/null 2>&1
#Settings
rm -fR /root/.couchpotato > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/CouchPotatoServer.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/CouchPotatoServer.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/CouchPotatoServer > /dev/null 2>&1
}
Uninstall_SickBeard()
{
uinst="1"
echo "uninstalling................SickBeard"
service sickbeard stop > /dev/null 2>&1
sleep 2
update-rc.d -f sickbeard remove > /dev/null 2>&1
rm -fR /etc/init.d/sickbeard > /dev/null 2>&1
rm -fR $INSTALLDIR/sickbeard > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/SickBeard.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/SickBeard.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/SickBeard > /dev/null 2>&1
}
Uninstall_Htpc()
{
uinst="1"
echo "uninstalling................HTPC Manager"
service HTPC_Manager stop > /dev/null 2>&1
sleep 2
update-rc.d -f HTPC_Manager remove > /dev/null 2>&1
rm -fR /etc/init.d/HTPC_Manager > /dev/null 2>&1
rm -fR $INSTALLDIR/HTPC_Manager > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/HTPC_Manager.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/HTPC_Manager.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/HTPC_Manager > /dev/null 2>&1
}
Uninstall_HeadPhones()
{
uinst="1"
echo "uninstalling................HeadPhones"
service headphones stop > /dev/null 2>&1
sleep 2
update-rc.d -f headphones remove > /dev/null 2>&1
rm -fR /etc/init.d/headphones > /dev/null 2>&1
rm -fR $INSTALLDIR/headphones > /dev/null 2>&1
sleep 2
rm -fR /var/run/headphones.pid > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/HeadPhones.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/HeadPhones.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/HeadPhones > /dev/null 2>&1
}
Uninstall_SABnzbd()
{
uinst="1"
echo "uninstalling................SABnzbd"
service SABnzbd stop > /dev/null 2>&1
sleep 2
update-rc.d -f SABnzbd remove > /dev/null 2>&1
rm -fR /etc/init.d/SABnzbd > /dev/null 2>&1
rm -fR $INSTALLDIR/SABnzbd > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/SABnzbd.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/SABnzbd.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/SABnzbd > /dev/null 2>&1
}
Uninstall_SubSonic()
{
uinst="1"
echo "uninstalling................SubSonic"
service subsonic stop > /dev/null 2>&1
sleep 2
update-rc.d -f subsonic remove > /dev/null 2>&1
rm -fR /etc/init.d/subsonic > /dev/null 2>&1
/usr/bin/apt-get -qq remove subsonic
rm -fR /etc/default/subsonic > /dev/null 2>&1
rm -fR /var/subsonic > /dev/null 2>&1
rm -fR /var/lib/dpkg/info/subsonic.list > /dev/null 2>&1
rm -fR /var/lib/dpkg/info/subsonic.postrm > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/SubSonic.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/SubSonic.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/SubSonic > /dev/null 2>&1
}
Uninstall_LazyLibrarian()
{
uinst="1"
echo "uninstalling................LazyLibrarian"
service LazyLibrarian stop > /dev/null 2>&1
sleep 2
update-rc.d -f LazyLibrarian remove > /dev/null 2>&1
rm -fR /etc/init.d/LazyLibrarian > /dev/null 2>&1
rm -fR $INSTALLDIR/LazyLibrarian > /dev/null 2>&1
rm -fR /root/.lazylibrarian > /dev/null 2>&1
rm -fR /var/run/lazylibrarian > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/LazyLibrarian.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/LazyLibrarian.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/LazyLibrarian > /dev/null 2>&1
}
Uninstall_PyLoad()
{
uinst="1"
echo "uninstalling................PyLoad"
service /root/.pyload stop > /dev/null 2>&1
rm -fR /usr/share/pyload > /dev/null 2>&1
/usr/bin/apt-get -qq remove pyload-cli
update-rc.d -f pyload remove > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/pyload > /dev/null 2>&1
rm -fR /root/.pyload > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/PyLoad.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/PyLoad.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/PyLoad > /dev/null 2>&1
}
Uninstall_newznab_free()
{
uinst="1"
echo "uninstalling................nZEDb"
sed -i "s#screen -dmS nZEDb /var/www/nZEDb/misc/update_scripts/nix_scripts/screen/threaded/start.sh##g" /etc/rc.local
sed -i "s#screen -dmS nZEDb /var/www/nZEDb/misc/update_scripts/nix_scripts/screen/sequential/simple.sh##g" /etc/rc.local
rm -Rf /var/www/nZEDb
rm -Rf /etc/apache2/sites-available/nZEDb
rm -Rf /etc/apache2/sites-available/newznab2
service apache2 restart > /dev/null 2>&1
}
Uninstall_newznab_paid()
{
uinst="1"
echo "uninstalling................newznab +"
sed -i "s#screen -dmS newznab /var/www/newznab/misc/update_scripts/nix_scripts/newznab_screen.sh##g" /etc/rc.local
rm -Rf /var/www/newznab
}
Uninstall_Maraschino()
{
uinst="1"
echo "uninstalling................Maraschino"
service maraschino stop > /dev/null 2>&1
sleep 2
update-rc.d -f maraschino remove > /dev/null 2>&1
rm -fR /etc/init.d/maraschino > /dev/null 2>&1
rm -fR $INSTALLDIR/maraschino > /dev/null 2>&1
sleep 2
rm -fR /var/run/maraschino.pid > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/Maraschino.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/Maraschino.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/Maraschino > /dev/null 2>&1
}
Uninstall_Deluge()
{
uinst="1"
echo "uninstalling................Deluge"
service deluge-daemon stop > /dev/null 2>&1
sleep 2
update-rc.d -f deluge-daemon remove > /dev/null 2>&1
rm -fR /etc/init.d/deluge-daemon > /dev/null 2>&1
sleep 2
rm -fR /usr/lib/python2.6/dist-packages/deluge-1.3.5-py2.6-linux-x86_64.egg > /dev/null 2>&1
rm -fR /usr/local/lib/python2.6/dist-packages/deluge-1.3.5-py2.6-linux-x86_64.egg > /dev/null 2>&1
rm -fR /root/.config/deluge > /dev/null 2>&1
rm -fR /var/log/deluge > /dev/null 2>&1
rm -fR /usr/local/bin/deluge > /dev/null 2>&1
rm -fR /usr/local/bin/deluged > /dev/null 2>&1
rm -fR /usr/local/bin/deluge-gtk > /dev/null 2>&1
rm -fR /usr/local/bin/deluge-web > /dev/null 2>&1
rm -fR /usr/local/bin/deluge-console > /dev/null 2>&1
rm -fR /usr/bin/deluge > /dev/null 2>&1
rm -fR /usr/bin/deluged > /dev/null 2>&1
rm -fR /usr/bin/deluge-gtk > /dev/null 2>&1
rm -fR /usr/bin/deluge-web > /dev/null 2>&1
rm -fR /usr/bin/deluge-console > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/Deluge.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/Deluge.js > /dev/null 2>&1
rm -fR /var/lib/deluge > /dev/null 2>&1
userdel deluge > /dev/null 2>&1
rm -fR /home/deluge > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/Deluge > /dev/null 2>&1
}
Uninstall_Auto-Sub()
{
uinst="1"
echo "uninstalling................Auto-Sub"
service Auto-Sub stop > /dev/null 2>&1
update-rc.d -f Auto-Sub remove > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/auto-sub > /dev/null 2>&1
rm -fR $INSTALLDIR/auto-sub > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/Auto-Sub.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/Auto-Sub.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/Auto-Sub > /dev/null 2>&1
/usr/bin/apt-get -qq purge mercurial
}
Uninstall_Extplorer()
{
uinst="1"
echo "uninstalling................Extplorer"
rm -fR /var/www/openmediavault/extplorer > /dev/null 2>&1
/usr/bin/apt-get -qq remove extplorer
rm -R /etc/extplorer > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/Extplorer.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/Extplorer.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/Extplorer > /dev/null 2>&1
#/etc/extplorer/.htusers.php
#<?php
#/** @version $Id: .htusers.php 135 2009-01-27 21:57:15Z ryu_ms $ */
#/** ensure this file is being included by a parent file */
#if( !defined( '_JEXEC' ) && !defined( '_VALID_MOS' ) ) die( 'Restricted access' );
#$GLOBALS["users"]=array(
# array("admin","21232f297a57a5a743894a0e4a801fc3",empty($_SERVER['DOCUMENT_ROOT'])?realpath(dirname(__FILE__).'/..'):$_SERVER['DOCUMENT_ROOT'],"http://localhost",1,"",7,1),
#); ?>
}
Uninstall_BicBucStriim()
{
uinst="1"
echo "uninstalling................BicBucStriim"
rm -fR /var/www/openmediavault/bbs > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/BicBucStriim.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/BicBucStriim.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/BicBucStriim > /dev/null 2>&1
}
Uninstall_MyLar()
{
uinst="1"
echo "uninstalling................MyLar"
service mylar stop > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/mylar > /dev/null 2>&1
update-rc.d -f mylar remove > /dev/null 2>&1
rm -fR $INSTALLDIR/mylar > /dev/null 2>&1
sleep 2
rm -fR /var/run/mylar.pid > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/MyLar.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/MyLar.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/MyLar > /dev/null 2>&1
}
Uninstall_Gamez()
{
uinst="1"
service GameZ stop > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/GameZ > /dev/null 2>&1
update-rc.d -f GameZ remove > /dev/null 2>&1
rm -fR $INSTALLDIR/GameZ > /dev/null 2>&1
sleep 2
rm -fR /var/run/GameZ.pid > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/GameZ.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/GameZ.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/GameZ > /dev/null 2>&1
}
Uninstall_XDM()
{
uinst="1"
service xdm stop > /dev/null 2>&1
sleep 2
rm -fR /etc/init.d/xdm > /dev/null 2>&1
update-rc.d -f xdm remove > /dev/null 2>&1
rm -fR $INSTALLDIR/XDM > /dev/null 2>&1
sleep 2
rm -fR /var/run/xdm.pid > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/XDM.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/XDM.js > /dev/null 2>&1
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/XDM > /dev/null 2>&1
}
Uninstall_MusicCabinet()
{
uinst="1"
echo "uninstalling................MusicCabinet"
service subsonic stop > /dev/null 2>&1
sleep 2
update-rc.d -f subsonic remove > /dev/null 2>&1
rm -fR /etc/init.d/subsonic > /dev/null 2>&1
/usr/bin/apt-get -qq remove subsonic > /dev/null 2>&1
rm -fR /etc/default/subsonic > /dev/null 2>&1
rm -fR /var/subsonic > /dev/null 2>&1
rm -fR /var/lib/dpkg/info/subsonic.list > /dev/null 2>&1
rm -fR /var/lib/dpkg/info/subsonic.postrm > /dev/null 2>&1
rm -fR /var/www/openmediavault/images/MusicCabinet.png > /dev/null 2>&1
rm -fR /var/www/openmediavault/js/omv/module/MusicCabinet.js > /dev/null 2>&1
t=10
appinstall=`dpkg-query -W -f '${package}\n' | grep postgres`
for item in ${appinstall[@]}; do
echo -ne $t% \\r
/usr/bin/apt-get -y remove "$item" > /dev/null 2>&1
sleep 2
/usr/bin/apt-get -y purge "$item" > /dev/null 2>&1
t=$(($t + 20))
done
rm -R /etc/postgresql-common
rm -R /var/lib/postgresql
rm -Rf /var/www/openmediavault/js/omv/module/admin/service/MusicCabinet > /dev/null 2>&1
}
getmysql()
{
screen;
echo "";
echo " --------------------------------MySql--------------------------------";
echo " You have an exsisting MySql install, in order to complete the install";
echo " we need to know your MySql password ";
echo "";
read -s -p "Your MySql password is? >" mypass
until mysql -u root -p$mypass -e ";" ; do
read -s -p "Can't connect, please retry: " mypass
done
}
menu()
{
screen;
if [ "$ip" == "localhost" ]; then
echo "Your current IP address is set to localhost";
echo "you need to change this to the actual IP address";
echo "of the OMV machine on the next screen";
sleep 2
changeip;
fi
echo "Just checking for any new updates for installed files"
echo "If this is a new install it will take some time"
echo "Please wait..."
apt-get --quiet --quiet update
/usr/bin/apt-get upgrade
SELECT=""
cpv="0"
cpm="0"
cpd="0"
sbm="0"
sbd="0"
sbt="0"
sbmg="0"
sbdg="0"
hpm="0"
hpd="0"
sab="0"
asub="0"
llm="0"
pyl="0"
nzbf="0"
nzbp="0"
mar="0"
del="0"
sub="0"
exp="0"
ml="0"
mc="0"
gz="0"
bbs="0"
htpc="0"
uml="0"
xdm="0"
ucpv="0"
ucpm="0"
ucpd="0"
usbm="0"
usbd="0"
usbt="0"
usbmg="0"
usbdg="0"
uhpm="0"
uhpd="0"
usab="0"
usub="0"
ullm="0"
upyl="0"
uinst="0"
unzbf="0"
unzbp="0"
umar="0"
udel="0"
uasub="0"
uexp="0"
ugz="0"
ubbs="0"
uxdm="0"
uhtpc="0"
#sleep 3
cd /tmp
#Menu & python option
screen;
p=""
echo " Please make a selection (e.g. 1)"
echo " Or select multiples (e.g. 1 4 5 7 10)"
echo " To uninstall use a minus sign (e.g. -1)"
echo " Change default [F]older or enter a new [I]p address"
echo ""
echo " 1. CouchPotato 10. Subsonic 4.9 beta3"
echo " 2. CouchPotatoServer (Master) 11. LazyLibrarian"
echo " 3. CouchPotatoServer (Develop) 12. PyLoad"
echo " 4. SickBeard (Master) 13. nZEDb"
echo " 5. SickBeard (Develop) 14. Newznab Paid"
echo " 6. SickBeard Torrent 15. Maraschino"
echo " 25. SickBeard German (Master) 16. Deluge"
echo " 26. SickBeard German (Develop) 17. Auto-Sub"
echo " 7. HeadPhones (Master) 18. Extplorer"
echo " 8. HeadPhones (Develop) 19. MyLar"
echo " 9. Sabnzbdplus 20. Music Cabinet"
echo " 21. GameZ 22. BicBucStriim"
echo " 23. XDM 24. HTPC Manager"
echo ""
echo " Q. Quit"
if [ "$INSTALLDIR" == "" ]; then
echo " [I]p:${ip} [F]older:root of drive"
else
echo " [I]p:${ip} [F]older:${INSTALLDIR}"
fi
read -p "Selection:> " SELECT
if [ "$SELECT" == "" ]; then
menu;
fi
#items=( $SELECT )
for item in ${SELECT[@]}; do
case "$item" in
# Uninstall CouchPotato
-1)
Uninstall_CouchPotatov1;
;;
# Uninstall CouchPotatoServer (Master)
-2)
Uninstall_CouchPotatoServer;
;;
# Uninstall CouchPotatoServer (Develop)
-3)
Uninstall_CouchPotatoServer;
;;
# Uninstall SickBeard (Master)
-4)
Uninstall_SickBeard;
;;
# Uninstall SickBeard (Develop)
-5)
Uninstall_SickBeard;
;;
# Uninstall SickBeard Torrent
-6)
Uninstall_SickBeard;
;;
# Uninstall HeadPhones (Master)
-7)
Uninstall_HeadPhones;
;;
# Uninstall HeadPhones (Develop)
-8)
Uninstall_HeadPhones;
;;
# Uninstall Sabnzbdplus
-9)
Uninstall_SABnzbd;
;;
# Uninstall Subsonic
-10)
Uninstall_SubSonic;
;;
# Uninstall LazyLibrarian
-11)
Uninstall_LazyLibrarian;
;;
# Uninstall PyLoad
-12)
Uninstall_PyLoad;
;;
# Uninstall newznab free
-13)
Uninstall_newznab_free;
;;
# Uninstall newznab +
-14)
Uninstall_newznab_paid;
;;
# Uninstall maraschino
-15)
Uninstall_Maraschino;
;;
# Uninstall deluce
-16)
Uninstall_Deluge;
;;
# Uninstall Auto-Sub
-17)
Uninstall_Auto-Sub;
;;
# Uninstall Extplorer
-18)
Uninstall_Extplorer;
;;
# Uninstall MyLar
-19)
Uninstall_MyLar;
;;
# Uninstall MusicCabinet
-20)
Uninstall_MusicCabinet;
;;
# Uninstall Gamez
-21)
Uninstall_Gamez;
;;
# Uninstall BicBucStriim
-22)
Uninstall_BicBucStriim;
;;
# Uninstall XDM
-23)
Uninstall_XDM;
;;
# Uninstall HTPC Manager
-24)
Uninstall_Htpc;
;;
# Uninstall SickBeard German (Master)
-25)
Uninstall_SickBeard;
;;
# Uninstall SickBeard German (Develop)
-26)
Uninstall_SickBeard;
;;
# CouchPotato
1)
cpv="1"
;;
# CouchPotatoServer (Master)
2)
cpm="1"
;;