Lines 87-95
Link Here
|
87 |
############################################ |
87 |
############################################ |
88 |
|
88 |
|
89 |
# echoes 1 if prey trigger is set |
89 |
# echoes 1 if prey trigger is set |
90 |
# TODO: check if this works in other distros beside the Debian derivatives |
90 |
# TODO: This should work on most major distros/derivatives, but as below, there's probably |
|
|
91 |
# a better way of doing this. |
91 |
is_trigger_loaded(){ |
92 |
is_trigger_loaded(){ |
92 |
find /etc/rc3.d/ | grep 'prey-trigger' > /dev/null && echo 1 |
93 |
if [ -d "/etc/rc3.d" ]; then |
|
|
94 |
find /etc/rc3.d/ | grep 'prey-trigger' > /dev/null && echo 1 |
95 |
elif [ -d "/etc/init.d" ]; then |
96 |
find /etc/init.d/ | grep 'prey-trigger' > /dev/null && echo 1 |
97 |
elif [ -d "/etc/rc.d" ]; then |
98 |
find /etc/rc.d/ | grep 'prey-trigger' > /dev/null && echo 1 |
99 |
fi |
93 |
} |
100 |
} |
94 |
|
101 |
|
95 |
reload_trigger(){ |
102 |
reload_trigger(){ |
Lines 146-168
Link Here
|
146 |
|
153 |
|
147 |
[ -n "$distro_name" ] && return 1 |
154 |
[ -n "$distro_name" ] && return 1 |
148 |
|
155 |
|
149 |
local proc_version=$(cat /proc/version 2>&1) |
156 |
proc_version=$(cat /proc/version) |
150 |
|
157 |
|
151 |
# todo: make this in a more efficient way |
158 |
# todo: make this in a more efficient way |
152 |
if [ -n `find_in $distro 'Ubuntu'` ]; then |
159 |
if [[ "$proc_version" == *Ubuntu* ]]; then |
153 |
distro_name=ubuntu |
160 |
distro_name=ubuntu |
154 |
elif [ -n `find_in $distro 'Debian'` ]; then |
161 |
elif [[ "$proc_version" == *Debian* ]]; then |
155 |
distro_name=debian |
162 |
distro_name=debian |
156 |
elif [ -n `find_in $distro 'Redhat'` ]; then |
163 |
elif [[ "$proc_version" == *Redhat* ]]; then |
157 |
distro_name=redhat |
164 |
distro_name=redhat |
158 |
elif [ -n `find_in $distro 'Fedora'` ]; then |
165 |
elif [[ "$proc_version" == *Fedora* ]]; then |
159 |
distro_name=fedora |
166 |
distro_name=fedora |
160 |
elif [ -n `find_in $distro 'CentOS'` ]; then |
167 |
elif [[ "$proc_version" == *CentOS* ]]; then |
161 |
distro_name=redhat |
168 |
distro_name=redhat |
162 |
elif [ -n `find_in $distro 'SuSE'` ]; then |
169 |
elif [[ "$proc_version" == *SuSE* ]]; then |
163 |
distro_name=suse |
170 |
distro_name=suse |
164 |
elif [ -n `find_in $distro 'ArchLinux'` ]; then |
171 |
# elif [[ "$proc_version" == *ArchLinux* ]]; then |
165 |
distro_name=arch |
172 |
# distro_name=arch |
|
|
173 |
# Hijack arch's distro name until upstream adds a gentoo distro |
174 |
elif [[ "$proc_version" == *Gentoo* ]]; then |
175 |
distro_name=arch |
166 |
else |
176 |
else |
167 |
distro_name=linux |
177 |
distro_name=linux |
168 |
fi |
178 |
fi |