Skip to content

Commit 2e52083

Browse files
author
Jenkins CI
committed
Merge branch 'ust_26874/add_a_command_to_reset_package_cache_pr' into branches/rudder/8.3
2 parents dec770b + fc8ae12 commit 2e52083

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

share/commands/agent-reset

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
# @man +
1212
# @man *Options*:
1313
# @man +
14+
# @man *-p*: just reset the package cache and nothing else
15+
# @man +
1416
# @man *-i*: run the agent in information mode, prints basic information
1517
# @man +
1618
# @man *-q*: run the agent in quiet mode (display only error messages)
@@ -23,7 +25,7 @@ VERBOSITY=""
2325
VERBOSE=false
2426
QUIET=false
2527

26-
while getopts "iIvdqc" opt; do
28+
while getopts "iIvdqcp" opt; do
2729
case $opt in
2830
i|I)
2931
VERBOSITY="-I ${INFO_CLASS}"
@@ -49,6 +51,12 @@ while getopts "iIvdqc" opt; do
4951
COLOR=""
5052
clear_colors
5153
;;
54+
p)
55+
# - remove state
56+
[ "$VERBOSE" = true ] && echo "Resetting package cache..."
57+
rm -f ${RUDDER_VAR}/cfengine-community/state/package_*
58+
exit $?
59+
;;
5260
esac
5361
done
5462

0 commit comments

Comments
 (0)