summaryrefslogtreecommitdiff
path: root/templates/system/package/repository/node.def
blob: b2f0349f071b32acb3fc2d88b1b8e07f22a33f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
tag:

type: txt

help: Set the name of a debian archive

commit:expression: $VAR(./url/) != ""; "Must configure the repository URL"
commit:expression: $VAR(./distribution/) != ""; "Must configure the repository distribution"
commit:expression: $VAR(./components/) != ""; "Must configure the repository components"

update: sudo bash -c "touch /etc/apt/sources.list && \
	sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list && \
	echo \"deb $VAR(url/@) $VAR(distribution/@) $VAR(components/@) # $VAR(@) #\" >> /tmp/$$-sources.list && \
	if [ $VAR(password/@) ] || [ $VAR(username/@) ]; \
	then \
		sed -i "s!://.*@!://!" /tmp/$$-sources.list; \
		sed -i "s!://!://$VAR(username/@):$VAR(password/@)@!" /tmp/$$-sources.list; \
	fi && \
	cat /tmp/$$-sources.list>>/etc/apt/sources.list ; \
	rm -f /tmp/$$-sources.list"

delete: sudo sh -c "touch /etc/apt/sources.list && \
sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list"