-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopsi_func.sh
More file actions
97 lines (85 loc) · 2.04 KB
/
opsi_func.sh
File metadata and controls
97 lines (85 loc) · 2.04 KB
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
#!/bin/bash
#
# Script-Name : $@.sh
# Version : 0.01
# Autor : Tobias Kern
# Datum : $DATE
# Lizenz : GPLv3
# Depends :
# Use :
#
# Example: opsi_ins.sh $#DOMAIN $TESTPW
#
# Sources:
# http://download.uib.de/opsi_stable/doc/opsi-getting-started-stable-de.pdf
# Description:
###########################################################################################
## Some Info and so one.
##
###########################################################################################
# Name of your script.
SCRIPTNAME=$(basename $0.sh)
# exit code without any error
EXIT_SUCCESS=0
# exit code I/O failure
EXIT_FAILURE=1
# exit code error if known
EXIT_ERROR=2
# unknown ERROR
EXIT_BUG=10
# Variable for optionsswitch
#OPTFILE=""
fbname=$(basename "$1".txt)
# simple help funktion, in this file because this function is only for the script itself
function usage {
echo "Usage: $SCRIPTNAME [-h] [-v] [-o arg] file ..." >&2
[[ $# -eq 1 ]] && exit $1 || exit $EXIT_FAILURE
}
function genpw {
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 18 | head -1
}
function onlyroot {
if [ $(id -u) != 0 ]; then
echo "Script is only for root user! Ask your Administrator"
exit 1
fi
}
function md5put {
md5sum $0 >> ./md5check-opsi.sum
}
function md5get {
md5sum << ./md5check-opsi.sum
}
function opsinstall {
aptitude update
aptitude safe-upgrade
aptitude remove tftpd
update-inetd --remove tftpd
aptitude install opsi-atftpd
aptitude install opsi-depotserver
aptitude install opsi-configed
}
function opsiconfig {
opsi-setup --auto-configure-samba
opsi-setup --configure-mysql
}
function opsiconfupdate {
opsi-setup --init-current-config
opsi-setup --set-rights
service opsiconfd restart
service opsipxeconfd restart
}
function opsidispatc {
echo "$DISPATCHCONF" >> /etc/opsi/backendManager/dispatch.conf
}
funtion jreinstall {
aptitude update
aptitude install openjdk-7-jre icedtea-7-plugin
}
#funktion md5vlalidsh {
##
#md5putresult=md5get
#if [ ! $md5putresult = 0 ]
# echo "Script overwirte detected please check your script!!!"
#exit 1
#}