Menu

[r10367]: / legacy / etc / install / upgrade.sh  Maximize  Restore  History

Download this file

41 lines (31 with data), 785 Bytes

 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
#!/bin/sh
# Copyright (c) 2008-2009 Volker Theile (votdev@gmx.de)
# All rights reserved.
. /etc/rc.subr
name="upgrade"
load_rc_config "$name"
# Custom commands
extra_commands="clean"
start_cmd=":"
stop_cmd=":"
clean_cmd="upgrade_clean"
# Defaults
upgrade_obsoletefiles=${upgrade_obsoletefiles:-"/etc/install/ObsoleteFiles.inc"}
upgrade_clean()
{
local _path _file _filepath
_path=$1
if [ -n ${_path} ]; then
for _file in $(cat ${upgrade_obsoletefiles} | grep -v "^#"); do
_filepath="${_path}/${_file}"
if [ -d "${_filepath}" ]; then
rm -d -r ${_filepath}
logger "Upgrade: Remove obsolete directory ${_file}."
elif [ -f "${_filepath}" ]; then
rm ${_filepath}
logger "Upgrade: Remove obsolete file ${_file}."
fi
done
fi
}
run_rc_command "$@"
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.